From 9731fc257299efe7a5f3663a3a4f4e5a88874f33 Mon Sep 17 00:00:00 2001 From: "P. Reis" Date: Fri, 21 Jun 2024 22:25:34 -0300 Subject: [PATCH] feat: add scavenger to the pipeline --- src/pipeline.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pipeline.ts b/src/pipeline.ts index 40ba9c12..bd56f09e 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -17,6 +17,7 @@ import { verifyEventWorker } from '@/workers/verify.ts'; import { nip05Cache } from '@/utils/nip05.ts'; import { updateStats } from '@/utils/stats.ts'; import { getTagSet } from '@/utils/tags.ts'; +import { scavengerEvent } from '@/utils/scavenger.ts'; const debug = Debug('ditto:pipeline'); @@ -50,7 +51,7 @@ async function handleEvent(event: DittoEvent, signal: AbortSignal): Promise { +async function storeEvent(event: DittoEvent, signal?: AbortSignal): Promise { if (NKinds.ephemeral(event.kind)) return; const store = await Storages.db(); const kysely = await DittoDB.getInstance(); await updateStats({ event, store, kysely }).catch(debug); await store.event(event, { signal }); + + return event; } /** Parse kind 0 metadata and track indexes in the database. */