From 1886c3c311db2e0b38c26ef1362c60e11ce5aa1a Mon Sep 17 00:00:00 2001 From: vrtnd Date: Tue, 18 Jun 2024 18:04:46 +0300 Subject: [PATCH] store recorded blocks --- src/handlers/runAllAdapters.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/handlers/runAllAdapters.ts b/src/handlers/runAllAdapters.ts index bc745a33..476a22d0 100644 --- a/src/handlers/runAllAdapters.ts +++ b/src/handlers/runAllAdapters.ts @@ -2,6 +2,7 @@ import { wrapScheduledLambda } from "../utils/wrap"; import bridgeNetworks from "../data/bridgeNetworkData"; import aws from "aws-sdk"; import { sql } from "../utils/db"; +import { store } from "../utils/s3"; async function invokeLambda(functioName: string, event: any) { return new Promise((resolve, _reject) => { @@ -27,6 +28,11 @@ export default wrapScheduledLambda(async (_event) => { GROUP BY bridge_id ) subquery; `; + try { + await store("lastRecordedBlocks.json", lastRecordedBlocks[0].result); + } catch (e) { + console.error(e); + } for (let i = 0; i < bridgeNetworks.length; i++) { await invokeLambda(`llama-bridges-prod-runAdapter`, { bridgeIndex: i,