From 23a3dd88ee14c546b6a842a5961db4f838048a74 Mon Sep 17 00:00:00 2001 From: amateima Date: Mon, 16 Dec 2024 16:58:08 +0200 Subject: [PATCH] fix: move away from updating chunks of relay hash info rows --- .../indexer/src/services/spokePoolProcessor.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/indexer/src/services/spokePoolProcessor.ts b/packages/indexer/src/services/spokePoolProcessor.ts index ac7c1a89..c788361d 100644 --- a/packages/indexer/src/services/spokePoolProcessor.ts +++ b/packages/indexer/src/services/spokePoolProcessor.ts @@ -177,16 +177,18 @@ export class SpokePoolProcessor { }), }; }); - const chunkedData = utils.chunk(data, this.queryBatchSize); - const upsertResult = await Promise.all( - chunkedData.map((chunk) => - relayHashInfoRepository.upsert(chunk, ["relayHash"]), - ), - ); + + const upsertResults = []; + for (const item of data) { + upsertResults.push( + await relayHashInfoRepository.upsert(item, ["relayHash"]), + ); + } + this.logger.debug({ at: "Indexer#SpokePoolProcessor#assignSpokeEventsToRelayHashInfo", message: `${eventType} events associated with RelayHashInfo`, - updatedRelayHashInfoRows: upsertResult.reduce( + updatedRelayHashInfoRows: upsertResults.reduce( (acc, res) => acc + res.generatedMaps.length, 0, ),