aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/scripts/pull_radar_relay_orders.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/pipeline/src/scripts/pull_radar_relay_orders.ts')
-rw-r--r--packages/pipeline/src/scripts/pull_radar_relay_orders.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/pipeline/src/scripts/pull_radar_relay_orders.ts b/packages/pipeline/src/scripts/pull_radar_relay_orders.ts
index 6c18bcaef..40bb6fc97 100644
--- a/packages/pipeline/src/scripts/pull_radar_relay_orders.ts
+++ b/packages/pipeline/src/scripts/pull_radar_relay_orders.ts
@@ -33,11 +33,12 @@ async function getOrderbookAsync(): Promise<void> {
// Save all the orders and update the observed time stamps in a single
// transaction.
console.log('Saving orders and updating timestamps...');
+ const observedTimestamp = Date.now();
await connection.transaction(async (manager: EntityManager): Promise<void> => {
for (const order of orders) {
await manager.save(SraOrder, order);
- const observedTimestamp = createObservedTimestampForOrder(order);
- await manager.save(observedTimestamp);
+ const orderObservation = createObservedTimestampForOrder(order, observedTimestamp);
+ await manager.save(orderObservation);
}
});
}