From 815b903e28ce6cbd4354b7999fca304af54f8200 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 4 Mar 2025 23:07:45 -0600 Subject: [PATCH] Add a timeout on pool.query --- packages/ditto/storages/DittoRelayStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ditto/storages/DittoRelayStore.ts b/packages/ditto/storages/DittoRelayStore.ts index fc29f1f6..246a9c9d 100644 --- a/packages/ditto/storages/DittoRelayStore.ts +++ b/packages/ditto/storages/DittoRelayStore.ts @@ -354,7 +354,7 @@ export class DittoRelayStore implements NRelay { } if (ids.size) { - for (const event of await pool.query([{ ids: [...ids] }])) { + for (const event of await pool.query([{ ids: [...ids] }], { signal: AbortSignal.timeout(1000) })) { await this.event(event).catch(() => {}); } }