From 8a15265f842a0a5fce721285edf5c04bfa6cf1f8 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 30 Oct 2022 23:13:48 -0700 Subject: [PATCH] even more aggressive reconnect on stale connections Signed-off-by: William Casarin --- damus/Nostr/RelayPool.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/damus/Nostr/RelayPool.swift b/damus/Nostr/RelayPool.swift index 4ef24457..f38a2a9d 100644 --- a/damus/Nostr/RelayPool.swift +++ b/damus/Nostr/RelayPool.swift @@ -84,7 +84,7 @@ class RelayPool { let is_connecting = c.isReconnecting || c.isConnecting - if is_connecting && (Date.now.timeIntervalSince1970 - c.last_connection_attempt) > 10 { + if is_connecting && (Date.now.timeIntervalSince1970 - c.last_connection_attempt) > 5 { print("stale connection detected (\(relay.descriptor.url.absoluteString)). retrying...") relay.connection.connect(force: true) } else if relay.is_broken || is_connecting || c.isConnected {