updateStats: await getStatsDiff

This commit is contained in:
Alex Gleason 2024-04-17 22:58:25 -05:00
parent a07d018ea6
commit c62c31a171
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 4 additions and 4 deletions

View File

@ -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 }));
}