deploy: ee757308c600ed23ccbd978bc99d6126b25c58a4

This commit is contained in:
jm-clius 2021-06-01 08:17:42 +00:00
parent 0da251bda3
commit 854ed5d12d
2 changed files with 9 additions and 3 deletions

View File

@ -2,7 +2,7 @@
# libtool - Provide generalized library-building support services.
# Generated automatically by config.status (libbacktrace) version-unused
# Libtool was configured on host fv-az132-75:
# Libtool was configured on host fv-az173-831:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,

View File

@ -28,9 +28,15 @@ proc keepAlive*(w: WakuRelay) {.async.} =
for topic in w.topics.keys:
trace "Keepalive on topic", topic=topic
let mpeers = w.mesh.getOrDefault(topic)
let
# Mesh peers for topic
mpeers = toSeq(w.mesh.getOrDefault(topic))
# Peers we're backing off from on topic
backoffPeers = w.backingOff.getOrDefault(topic)
# Only keep peers alive that we're not backing off from
keepAlivePeers = mpeers.filterIt(not backoffPeers.hasKey(it.peerId))
w.broadcast(toSeq(mpeers), RPCMsg(control: some(ControlMessage(graft: @[ControlGraft(topicID: topic)]))))
w.broadcast(keepAlivePeers, RPCMsg(control: some(ControlMessage(graft: @[ControlGraft(topicID: topic)]))))
await sleepAsync(DefaultKeepAlive)