Skip to content

Commit

Permalink
fix(core): Fix search indexing issue when working with multiple chann…
Browse files Browse the repository at this point in the history
…els (#3041)

Relates to #3012.
  • Loading branch information
hsensh authored Sep 2, 2024
1 parent a48c818 commit 75ed6e1
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,9 @@ export class IndexerController {
await this.removeSyntheticVariants(ctx, variants);
const productMap = new Map<ID, Product>();

const originalChannel = ctx.channel;
for (const variant of variants) {
ctx.setChannel(originalChannel);
let product = productMap.get(variant.productId);
if (!product) {
product = await this.getProductInChannelQueryBuilder(ctx, variant.productId, ctx.channel);
Expand Down Expand Up @@ -496,6 +498,7 @@ export class IndexerController {
}
}
}
ctx.setChannel(originalChannel);

await this.queue.push(() =>
this.connection.getRepository(ctx, SearchIndexItem).save(items, { chunk: 2500 }),
Expand Down

0 comments on commit 75ed6e1

Please sign in to comment.