Add a timeout on pool.query

This commit is contained in:
Alex Gleason 2025-03-04 23:07:45 -06:00
parent 773cee8b92
commit 815b903e28
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

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