Skip to content

Commit

Permalink
use put instead of putNoWait
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos committed Jan 30, 2024
1 parent 36d9ec7 commit 6d9cbf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libp2p/protocols/pubsub/pubsubpeer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,11 @@ proc sendEncoded*(p: PubSubPeer, msg: seq[byte], isHighPriority: bool = false) {
return

if isHighPriority:
p.rpcmessagequeue.priorityQueue.putNoWait(msg)
await p.rpcmessagequeue.priorityQueue.put(msg)
when defined(libp2p_expensive_metrics):
libp2p_gossipsub_priority_queue_size.inc(labelValues = [$p.peerId])
else:
p.rpcmessagequeue.nonPriorityQueue.putNoWait(msg)
await p.rpcmessagequeue.nonPriorityQueue.put(msg)
when defined(libp2p_expensive_metrics):
libp2p_gossipsub_non_priority_queue_size.inc(labelValues = [$p.peerId])
trace "message queued", p, msg = shortLog(msg)
Expand Down

0 comments on commit 6d9cbf4

Please sign in to comment.