mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-03 22:43:09 +00:00
peer_manager: prevent too intense loop when no peers connected (#3130)
This commit is contained in:
parent
56652960f0
commit
8e1b2a60b2
@ -928,7 +928,7 @@ proc relayConnectivityLoop*(pm: PeerManager) {.async.} =
|
||||
chronos.seconds(int(float(ConnectivityLoopInterval.seconds()) * factor))
|
||||
|
||||
# Shorten the connectivity loop interval dynamically based on percentage of peers to fill or connections to prune
|
||||
await sleepAsync(dynamicSleepInterval)
|
||||
await sleepAsync(max(dynamicSleepInterval, chronos.seconds(1)))
|
||||
|
||||
proc pruneInRelayConns(pm: PeerManager, amount: int) {.async.} =
|
||||
if amount <= 0:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user