always close relay connections

This commit is contained in:
zappityzap 2025-01-05 10:07:02 -08:00
parent 696ccfaec3
commit e421c4eda5

View file

@ -70,10 +70,11 @@ class Nostr extends NotificationProvider {
for (let i = eventIndex; i < events.length; i++) { for (let i = eventIndex; i < events.length; i++) {
await relay.publish(events[i]); await relay.publish(events[i]);
} }
relay.close();
successfulRelays++; successfulRelays++;
} catch (error) { } catch (error) {
console.error(`Failed to publish event to ${relayUrl}:`, error); console.error(`Failed to publish event to ${relayUrl}:`, error);
} finally {
relay.close();
} }
} }