From 2fd50261f9b1032ae64614d49a410302eb9c8074 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 14 May 2024 19:11:38 -0500 Subject: [PATCH] streaming: actually hydrate with optimizer --- src/controllers/api/streaming.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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), });