diff --git a/impex/src/lib.rs b/impex/src/lib.rs index f325f5b..89f45a4 100644 --- a/impex/src/lib.rs +++ b/impex/src/lib.rs @@ -49,7 +49,7 @@ struct Command { sku_file: String, concurrency: usize, rate_limit: NonZeroU32, - skip_cat_lookup: usize + skip_cat_lookup: usize, } arg_enum! { @@ -676,7 +676,7 @@ impl Command { sku_file: "".to_string(), concurrency: 1, rate_limit: NonZeroU32::new(1).unwrap(), - skip_cat_lookup: 0 + skip_cat_lookup: 0, }; match matches.subcommand() { @@ -997,7 +997,7 @@ pub async fn run() -> Result<(), Box> { environment, cmd.concurrency, cmd.rate_limit, - cmd.skip_cat_lookup + cmd.skip_cat_lookup, ) .await?; } else if cmd.action.eq("update") { @@ -1008,7 +1008,7 @@ pub async fn run() -> Result<(), Box> { environment, cmd.concurrency, cmd.rate_limit, - cmd.skip_cat_lookup + cmd.skip_cat_lookup, ) .await?; } diff --git a/impex/src/products.rs b/impex/src/products.rs index 5bc43f8..26ea747 100644 --- a/impex/src/products.rs +++ b/impex/src/products.rs @@ -19,19 +19,19 @@ pub async fn load_products( environment: String, concurrent_requests: usize, rate_limit: NonZeroU32, - skip_cat_lookup: usize + skip_cat_lookup: usize, ) -> Result<(), Box> { info!("Starting load of products"); // Read in the category tree and store in a HashMap for lookup let mut categories = Vec::new(); let mut category_lookup: HashMap = HashMap::new(); let mut category_identifier_name_lookup: HashMap = HashMap::new(); - + if skip_cat_lookup == 0 { categories = utils::get_vtex_category_tree(client, &account_name, &environment).await; category_lookup = utils::parse_category_tree(categories); debug!("category_lookup: {:?}", category_lookup.len()); - + // Get a lookup for the cateogory name of a category by GroupIdentifier category_identifier_name_lookup = utils::create_category_name_lookup(client, &account_name, &environment).await; @@ -126,20 +126,20 @@ pub async fn update_products( environment: String, concurrent_requests: usize, rate_limit: NonZeroU32, - skip_cat_lookup: usize + skip_cat_lookup: usize, ) -> Result<(), Box> { info!("Starting load of products"); // Read in the category tree and store in a HashMap for lookup let mut categories = Vec::new(); let mut category_lookup: HashMap = HashMap::new(); let mut category_identifier_name_lookup: HashMap = HashMap::new(); - + debug!("skip_cat_lookup={}", skip_cat_lookup); if skip_cat_lookup == 0 { categories = utils::get_vtex_category_tree(client, &account_name, &environment).await; category_lookup = utils::parse_category_tree(categories); debug!("category_lookup: {:?}", category_lookup.len()); - + // Get a lookup for the cateogory name of a category by GroupIdentifier category_identifier_name_lookup = utils::create_category_name_lookup(client, &account_name, &environment).await;