use put instead of putNoWait

This commit is contained in:
Diego 2024-01-25 14:15:08 +01:00
parent 36d9ec7e48
commit 6d9cbf4bec
No known key found for this signature in database
GPG Key ID: C9DAC9BF68D1F806
1 changed files with 2 additions and 2 deletions

View File

@ -264,11 +264,11 @@ proc sendEncoded*(p: PubSubPeer, msg: seq[byte], isHighPriority: bool = false) {
return return
if isHighPriority: if isHighPriority:
p.rpcmessagequeue.priorityQueue.putNoWait(msg) await p.rpcmessagequeue.priorityQueue.put(msg)
when defined(libp2p_expensive_metrics): when defined(libp2p_expensive_metrics):
libp2p_gossipsub_priority_queue_size.inc(labelValues = [$p.peerId]) libp2p_gossipsub_priority_queue_size.inc(labelValues = [$p.peerId])
else: else:
p.rpcmessagequeue.nonPriorityQueue.putNoWait(msg) await p.rpcmessagequeue.nonPriorityQueue.put(msg)
when defined(libp2p_expensive_metrics): when defined(libp2p_expensive_metrics):
libp2p_gossipsub_non_priority_queue_size.inc(labelValues = [$p.peerId]) libp2p_gossipsub_non_priority_queue_size.inc(labelValues = [$p.peerId])
trace "message queued", p, msg = shortLog(msg) trace "message queued", p, msg = shortLog(msg)