Skip to content

Commit

Permalink
chore: remove debug changes
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 committed Dec 10, 2024
1 parent 431c364 commit 462b298
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ export class IndexerController {
}

private async saveVariants(ctx: MutableRequestContext, variants: ProductVariant[]) {
const items: SearchIndexItem[] = [];

await this.removeSyntheticVariants(ctx, variants);
const productMap = new Map<ID, Product>();

Expand All @@ -419,8 +421,6 @@ export class IndexerController {
? unique(ctx.channel.availableCurrencyCodes)
: [ctx.channel.defaultCurrencyCode];

const items: SearchIndexItem[] = [];

for (const currencyCode of availableCurrencyCodes) {
for (const languageCode of availableLanguageCodes) {
const productTranslation = this.getTranslation(product, languageCode);
Expand All @@ -445,7 +445,6 @@ export class IndexerController {
ctx.setChannel(ch);

await this.productPriceApplicator.applyChannelPriceAndTax(variant, ctx);

const item = new SearchIndexItem({
channelId: ctx.channelId,
languageCode,
Expand Down Expand Up @@ -504,18 +503,16 @@ export class IndexerController {
);
item.productInStock = productInStock;
}

items.push(item);
}
}
}

ctx.setChannel(originalChannel);

await this.queue.push(() =>
this.connection.rawConnection.getRepository(SearchIndexItem).save(items, { chunk: 2500 }),
);
}
ctx.setChannel(originalChannel);

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

/**
Expand Down

0 comments on commit 462b298

Please sign in to comment.