From 1e75007c621e3aa6085e6b08508fa34530e003de Mon Sep 17 00:00:00 2001 From: Denis Carriere Date: Tue, 20 Feb 2024 20:49:28 -0500 Subject: [PATCH] format --- index.ts | 4 +--- src/postWebhook.ts | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/index.ts b/index.ts index 0870fff..e40e915 100644 --- a/index.ts +++ b/index.ts @@ -16,7 +16,7 @@ export async function action(options: WebhookRunOptions) { const finalBlocksOnly = boolean.parse(options.finalBlocksOnly); // Block Emitter - const { emitter, moduleHash } = await setup({...options, cursor}); + const { emitter, moduleHash } = await setup({ ...options, cursor }); // Queue const queue = new PQueue({ concurrency: 1 }); // all messages are sent in block order, no need to parallelize @@ -80,5 +80,3 @@ export async function action(options: WebhookRunOptions) { http.server.close(); }); } - - diff --git a/src/postWebhook.ts b/src/postWebhook.ts index 6ec2293..841cd45 100644 --- a/src/postWebhook.ts +++ b/src/postWebhook.ts @@ -18,17 +18,18 @@ function now() { } let blocks = 0; -let start = now(); +const start = now(); // let lastUpdate = now(); // TO-DO replace with Prometheus metrics function logProgress(metadata?: Metadata) { - if ( !metadata ) return; + if (!metadata) return; const delta = now() - start; const rate = Math.round(blocks / delta); const minutes = Math.round(delta / 60); const seconds = delta % 60; - if ( blocks ) logUpdate(`[app] timestamp=${metadata.clock.timestamp} block_number=${metadata.clock.number} blocks=${blocks} [${rate} b/s] (${minutes}m ${seconds}s)`); + if (blocks) + logUpdate(`[app] timestamp=${metadata.clock.timestamp} block_number=${metadata.clock.number} blocks=${blocks} [${rate} b/s] (${minutes}m ${seconds}s)`); blocks++; }