diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-11-15 09:40:19 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-06 19:04:25 +0800 |
commit | a0a41b1b5d4f9bcaf4fd15ccf628e7e6b88b4621 (patch) | |
tree | 863148475bf5ccba68f47bd2aaf2ffb04394e1f9 | |
parent | f07dc5ae6d4cc928e4d00708e3f90f7cf9b4836d (diff) | |
download | dexon-sol-tools-a0a41b1b5d4f9bcaf4fd15ccf628e7e6b88b4621.tar.gz dexon-sol-tools-a0a41b1b5d4f9bcaf4fd15ccf628e7e6b88b4621.tar.zst dexon-sol-tools-a0a41b1b5d4f9bcaf4fd15ccf628e7e6b88b4621.zip |
Fix chunk size in pull_missing_events
-rw-r--r-- | packages/pipeline/src/scripts/pull_missing_events.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/pipeline/src/scripts/pull_missing_events.ts b/packages/pipeline/src/scripts/pull_missing_events.ts index b1b8665dd..f53bc12bd 100644 --- a/packages/pipeline/src/scripts/pull_missing_events.ts +++ b/packages/pipeline/src/scripts/pull_missing_events.ts @@ -38,7 +38,7 @@ async function getExchangeEventsAsync(provider: Web3ProviderEngine): Promise<voi const events = parseExchangeEvents(eventLogs); console.log(`Retrieved and parsed ${events.length} total events.`); console.log('Saving events...'); - await eventsRepository.save(events, { chunk: BATCH_SAVE_SIZE }); + await eventsRepository.save(events, { chunk: Math.ceil(events.length / BATCH_SAVE_SIZE) }); const totalEvents = await eventsRepository.count(); console.log(`Done saving events. There are now ${totalEvents} total events.`); } |