Comparing version 9.0.1 to 9.0.2
@@ -155,4 +155,3 @@ "use strict"; | ||
const binding = new Binding(this, queue, pattern, bindOptions); | ||
bindings.push(binding); | ||
if (bindings.length > 1 && binding.options.priority) { | ||
if (bindings.push(binding) > 1 && binding.options.priority) { | ||
bindings.sort(_shared.sortByPriority); | ||
@@ -159,0 +158,0 @@ } |
@@ -119,4 +119,5 @@ "use strict"; | ||
const consumer = new Consumer(this, onMessage, consumeOptions, owner, new ConsumerEmitter(this)); | ||
consumers.push(consumer); | ||
consumers.sort(_shared.sortByPriority); | ||
if (consumers.push(consumer) > 1 && consumer.options.priority) { | ||
consumers.sort(_shared.sortByPriority); | ||
} | ||
if (consumer.options.exclusive) { | ||
@@ -123,0 +124,0 @@ this[kExclusive] = true; |
{ | ||
"name": "smqp", | ||
"version": "9.0.1", | ||
"version": "9.0.2", | ||
"type": "module", | ||
@@ -65,3 +65,3 @@ "description": "Synchronous message queueing package", | ||
"@babel/preset-env": "^7.24.4", | ||
"c8": "^9.1.0", | ||
"c8": "^10.1.2", | ||
"chai": "^5.1.0", | ||
@@ -68,0 +68,0 @@ "chronokinesis": "^6.0.0", |
@@ -153,5 +153,3 @@ import { Message } from './Message.js'; | ||
const binding = new Binding(this, queue, pattern, bindOptions); | ||
bindings.push(binding); | ||
if (bindings.length > 1 && binding.options.priority) { | ||
if (bindings.push(binding) > 1 && binding.options.priority) { | ||
bindings.sort(sortByPriority); | ||
@@ -158,0 +156,0 @@ } |
@@ -128,4 +128,5 @@ import { generateId, sortByPriority } from './shared.js'; | ||
const consumer = new Consumer(this, onMessage, consumeOptions, owner, new ConsumerEmitter(this)); | ||
consumers.push(consumer); | ||
consumers.sort(sortByPriority); | ||
if (consumers.push(consumer) > 1 && consumer.options.priority) { | ||
consumers.sort(sortByPriority); | ||
} | ||
@@ -132,0 +133,0 @@ if (consumer.options.exclusive) { |
125467