dont add finished future
This commit is contained in:
parent
451637a644
commit
df0b98bfdd
|
@ -287,9 +287,11 @@ proc sendEncoded*(p: PubSubPeer, msg: seq[byte], isHighPriority: bool = false) {
|
||||||
return
|
return
|
||||||
|
|
||||||
if isHighPriority:
|
if isHighPriority:
|
||||||
p.rpcmessagequeue.sendPriorityQueue.addLast(p.sendMsg(msg))
|
let f = p.sendMsg(msg)
|
||||||
when defined(libp2p_expensive_metrics):
|
if not f.finished:
|
||||||
libp2p_gossipsub_priority_queue_size.inc(labelValues = [$p.peerId])
|
p.rpcmessagequeue.sendPriorityQueue.addLast(f)
|
||||||
|
when defined(libp2p_expensive_metrics):
|
||||||
|
libp2p_gossipsub_priority_queue_size.inc(labelValues = [$p.peerId])
|
||||||
else:
|
else:
|
||||||
await p.rpcmessagequeue.nonPriorityQueue.addLast(msg)
|
await p.rpcmessagequeue.nonPriorityQueue.addLast(msg)
|
||||||
when defined(libp2p_expensive_metrics):
|
when defined(libp2p_expensive_metrics):
|
||||||
|
|
Loading…
Reference in New Issue