diff --git a/src/controllers/api/streaming.ts b/src/controllers/api/streaming.ts index 1de7bbf..ff47c07 100644 --- a/src/controllers/api/streaming.ts +++ b/src/controllers/api/streaming.ts @@ -68,8 +68,8 @@ const streamingController: AppController = (c) => { if (!filter) return; try { - const db = await Storages.db(); const pubsub = await Storages.pubsub(); + const optimizer = await Storages.optimizer(); for await (const msg of pubsub.req([filter], { signal: controller.signal })) { if (msg[0] === 'EVENT') { @@ -77,7 +77,7 @@ const streamingController: AppController = (c) => { await hydrateEvents({ events: [event], - store: db, + store: optimizer, signal: AbortSignal.timeout(1000), });