diff --git a/.changeset/big-countries-drive.md b/.changeset/big-countries-drive.md new file mode 100644 index 0000000000..8484d58369 --- /dev/null +++ b/.changeset/big-countries-drive.md @@ -0,0 +1,5 @@ +--- +"@medusajs/medusa": patch +--- + +Dont 'set' in cache if ignore_cache option is true diff --git a/packages/medusa/src/strategies/price-selection.ts b/packages/medusa/src/strategies/price-selection.ts index e5a23fc820..d9c4eeefc4 100644 --- a/packages/medusa/src/strategies/price-selection.ts +++ b/packages/medusa/src/strategies/price-selection.ts @@ -96,7 +96,9 @@ class PriceSelectionStrategy extends AbstractPriceSelectionStrategy { await Promise.all( [...results].map(async ([variantId, prices]) => { variantPricesMap.set(variantId, prices) - await this.cacheService_.set(cacheKeysMap.get(variantId)!, prices) + if (!context.ignore_cache) { + await this.cacheService_.set(cacheKeysMap.get(variantId)!, prices) + } }) )