diff --git a/server/notification-providers/nostr.js b/server/notification-providers/nostr.js index 1775feb76..a6bb57117 100644 --- a/server/notification-providers/nostr.js +++ b/server/notification-providers/nostr.js @@ -70,10 +70,11 @@ class Nostr extends NotificationProvider { for (let i = eventIndex; i < events.length; i++) { await relay.publish(events[i]); } - relay.close(); successfulRelays++; } catch (error) { console.error(`Failed to publish event to ${relayUrl}:`, error); + } finally { + relay.close(); } }