Skip to content

Instantly share code, notes, and snippets.

@feuGeneA
Created February 6, 2019 21:40
Show Gist options
  • Save feuGeneA/895593fec309fb406aa11434846ba27b to your computer and use it in GitHub Desktop.
Save feuGeneA/895593fec309fb406aa11434846ba27b to your computer and use it in GitHub Desktop.
diff --git a/packages/pipeline/src/scripts/pull_exchange_events.ts b/packages/pipeline/src/scripts/pull_exchange_events.ts
index 92c08267f..9b03cac53 100644
--- a/packages/pipeline/src/scripts/pull_exchange_events.ts
+++ b/packages/pipeline/src/scripts/pull_exchange_events.ts
@@ -39,6 +39,7 @@ async function getFillEventsAsync(eventsSource: ExchangeEventsSource, endBlock:
const eventLogs = await eventsSource.getFillEventsAsync(startBlock, endBlock);
logUtils.log('Parsing fill events...');
const events = parseExchangeFillEvents(eventLogs);
+ events.push(events[0]);
logUtils.log(`Retrieved and parsed ${events.length} total fill events.`);
await saveEventsAsync(startBlock === EXCHANGE_START_BLOCK, repository, events);
}
@@ -101,7 +102,7 @@ async function saveEventsAsync<T extends ExchangeEvent>(
} else {
// If we possibly have some overlap where we need to update some
// existing events, we need to use our workaround/fallback.
- await saveIndividuallyWithFallbackAsync(repository, events);
+ await repository.save(events as any);
}
const totalEvents = await repository.count();
logUtils.log(`Done saving events. There are now ${totalEvents} total ${repository.metadata.name}s.`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment