mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-09 11:34:00 +00:00
cleanups
This commit is contained in:
parent
3a657135dc
commit
680dcfd9cb
@ -19,8 +19,7 @@ import pubsub,
|
|||||||
../../peerinfo,
|
../../peerinfo,
|
||||||
../../stream/connection,
|
../../stream/connection,
|
||||||
../../peer,
|
../../peer,
|
||||||
../../errors,
|
../../errors
|
||||||
../../utility
|
|
||||||
|
|
||||||
logScope:
|
logScope:
|
||||||
topics = "gossipsub"
|
topics = "gossipsub"
|
||||||
@ -55,7 +54,6 @@ type
|
|||||||
heartbeatFut: Future[void] # cancellation future for heartbeat interval
|
heartbeatFut: Future[void] # cancellation future for heartbeat interval
|
||||||
heartbeatRunning: bool
|
heartbeatRunning: bool
|
||||||
heartbeatLock: AsyncLock # heartbeat lock to prevent two consecutive concurrent heartbeats
|
heartbeatLock: AsyncLock # heartbeat lock to prevent two consecutive concurrent heartbeats
|
||||||
subLock: AsyncLock
|
|
||||||
|
|
||||||
declareGauge(libp2p_gossipsub_peers_per_topic_mesh, "gossipsub peers per topic in mesh", labels = ["topic"])
|
declareGauge(libp2p_gossipsub_peers_per_topic_mesh, "gossipsub peers per topic in mesh", labels = ["topic"])
|
||||||
declareGauge(libp2p_gossipsub_peers_per_topic_fanout, "gossipsub peers per topic in fanout", labels = ["topic"])
|
declareGauge(libp2p_gossipsub_peers_per_topic_fanout, "gossipsub peers per topic in fanout", labels = ["topic"])
|
||||||
@ -548,4 +546,3 @@ method initPubSub*(g: GossipSub) =
|
|||||||
g.gossip = initTable[string, seq[ControlIHave]]() # pending gossip
|
g.gossip = initTable[string, seq[ControlIHave]]() # pending gossip
|
||||||
g.control = initTable[string, ControlMessage]() # pending control messages
|
g.control = initTable[string, ControlMessage]() # pending control messages
|
||||||
g.heartbeatLock = newAsyncLock()
|
g.heartbeatLock = newAsyncLock()
|
||||||
g.subLock = newAsyncLock()
|
|
||||||
|
@ -39,7 +39,7 @@ proc waitSub(sender, receiver: auto; key: string) {.async, gcsafe.} =
|
|||||||
(not fsub.fanout.hasKey(key) or
|
(not fsub.fanout.hasKey(key) or
|
||||||
not fsub.fanout[key].contains(receiver.peerInfo.id)):
|
not fsub.fanout[key].contains(receiver.peerInfo.id)):
|
||||||
trace "waitSub sleeping..."
|
trace "waitSub sleeping..."
|
||||||
await sleepAsync(100.millis)
|
await sleepAsync(1.seconds)
|
||||||
dec ceil
|
dec ceil
|
||||||
doAssert(ceil > 0, "waitSub timeout!")
|
doAssert(ceil > 0, "waitSub timeout!")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user