From c62c31a1715021a66c1cdac9f9406e3fb9f3f5bc Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 17 Apr 2024 22:58:25 -0500 Subject: [PATCH] updateStats: await getStatsDiff --- src/stats.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/stats.ts b/src/stats.ts index 01b870ec..0d6c8e8f 100644 --- a/src/stats.ts +++ b/src/stats.ts @@ -25,11 +25,11 @@ async function updateStats(event: NostrEvent) { } } - const statDiffs = getStatsDiff(event, prev); - const pubkeyDiffs = (await statDiffs).filter(([table]) => table === 'author_stats') as AuthorStatDiff[]; - const eventDiffs = (await statDiffs).filter(([table]) => table === 'event_stats') as EventStatDiff[]; + const statDiffs = await getStatsDiff(event, prev); + const pubkeyDiffs = statDiffs.filter(([table]) => table === 'author_stats') as AuthorStatDiff[]; + const eventDiffs = statDiffs.filter(([table]) => table === 'event_stats') as EventStatDiff[]; - if ((await statDiffs).length) { + if (statDiffs.length) { debug(JSON.stringify({ id: event.id, pubkey: event.pubkey, kind: event.kind, tags: event.tags, statDiffs })); }