diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-12-05 12:08:32 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-12-05 12:08:32 +0800 |
commit | 2e704ac01a077b0c73288aaa53c9cf66c73e27f1 (patch) | |
tree | 091b2c8314ec2784f1ad508964999f2eed9f85f6 /packages/pipeline/src/scripts | |
parent | 00f86ca0f7871639d2b0be496f6f8c5e0d8d7ffe (diff) | |
download | dexon-sol-tools-2e704ac01a077b0c73288aaa53c9cf66c73e27f1.tar dexon-sol-tools-2e704ac01a077b0c73288aaa53c9cf66c73e27f1.tar.gz dexon-sol-tools-2e704ac01a077b0c73288aaa53c9cf66c73e27f1.tar.bz2 dexon-sol-tools-2e704ac01a077b0c73288aaa53c9cf66c73e27f1.tar.lz dexon-sol-tools-2e704ac01a077b0c73288aaa53c9cf66c73e27f1.tar.xz dexon-sol-tools-2e704ac01a077b0c73288aaa53c9cf66c73e27f1.tar.zst dexon-sol-tools-2e704ac01a077b0c73288aaa53c9cf66c73e27f1.zip |
Fix prettier
Diffstat (limited to 'packages/pipeline/src/scripts')
-rw-r--r-- | packages/pipeline/src/scripts/pull_radar_relay_orders.ts | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/packages/pipeline/src/scripts/pull_radar_relay_orders.ts b/packages/pipeline/src/scripts/pull_radar_relay_orders.ts index bbbef9b47..6c18bcaef 100644 --- a/packages/pipeline/src/scripts/pull_radar_relay_orders.ts +++ b/packages/pipeline/src/scripts/pull_radar_relay_orders.ts @@ -29,22 +29,17 @@ async function getOrderbookAsync(): Promise<void> { console.log(`Got ${rawOrders.records.length} orders.`); console.log('Parsing orders...'); // Parse the sra orders, then add source url to each. - const orders = R.pipe( - parseSraOrders, - R.map(setSourceUrl(RADAR_RELAY_URL)), - )(rawOrders); + const orders = R.pipe(parseSraOrders, R.map(setSourceUrl(RADAR_RELAY_URL)))(rawOrders); // Save all the orders and update the observed time stamps in a single // transaction. console.log('Saving orders and updating timestamps...'); - 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); - } - }, - ); + 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 sourceUrlProp = R.lensProp('sourceUrl'); @@ -53,8 +48,6 @@ const sourceUrlProp = R.lensProp('sourceUrl'); * Sets the source url for a single order. Returns a new order instead of * mutating the given one. */ -const setSourceUrl = R.curry( - (sourceURL: string, order: SraOrder): SraOrder => { - return R.set(sourceUrlProp, sourceURL, order); - }, -); +const setSourceUrl = R.curry((sourceURL: string, order: SraOrder): SraOrder => { + return R.set(sourceUrlProp, sourceURL, order); +}); |