attempt reconnects every 4 seconds instead of 60

Changelog-Fixed: Damus will now stay connected at all times
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2022-10-16 11:05:19 -07:00
parent 2c4c392b76
commit 054714794d
2 changed files with 3 additions and 12 deletions

View File

@@ -68,7 +68,7 @@ struct ContentView: View {
@StateObject var home: HomeModel = HomeModel()
// connect retry timer
let timer = Timer.publish(every: 60, on: .main, in: .common).autoconnect()
let timer = Timer.publish(every: 4, on: .main, in: .common).autoconnect()
let sub_id = UUID().description
@@ -329,6 +329,7 @@ struct ContentView: View {
}
.onReceive(timer) { n in
self.damus_state?.pool.connect_to_disconnected()
update_signal_from_pool(signal: self.home.signal, pool: self.damus_state!.pool)
}
}