Skip to content

Commit

Permalink
peer_manager: prevent too intense loop when no peers connected (#3130)
Browse files Browse the repository at this point in the history
Signed-off-by: DarshanBPatel <[email protected]>
  • Loading branch information
Ivansete-status authored and darshankabariya committed Oct 23, 2024
1 parent 7916741 commit 8e86fac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion waku/node/peer_manager/peer_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8e86fac

Please sign in to comment.