try-catch the InternalRelay req's

This commit is contained in:
Alex Gleason
2024-04-25 16:36:20 -05:00
parent 7a18a19b2f
commit 7aa931a69e
4 changed files with 28 additions and 26 deletions

View File

@@ -77,10 +77,14 @@ function connectStream(socket: WebSocket) {
send(['EOSE', subId]);
for await (const msg of Storages.pubsub.req(filters, { signal: controller.signal })) {
if (msg[0] === 'EVENT') {
send(['EVENT', subId, msg[2]]);
try {
for await (const msg of Storages.pubsub.req(filters, { signal: controller.signal })) {
if (msg[0] === 'EVENT') {
send(['EVENT', subId, msg[2]]);
}
}
} catch (_e) {
controllers.delete(subId);
}
}