@autofleet/rabbit 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/dist/index.js
CHANGED
|
@@ -90,7 +90,7 @@ class RabbitMq {
|
|
|
90
90
|
return channel.addSetup((c) => c.assertQueue(queue));
|
|
91
91
|
}
|
|
92
92
|
async consume(queue, callback, options) {
|
|
93
|
-
const { limit } = options ? options : 1;
|
|
93
|
+
const { limit } = (options && options.limit) ? options : { limit: 1 };
|
|
94
94
|
const channel = await this.assertChannel();
|
|
95
95
|
await this.assertQueue(queue);
|
|
96
96
|
return channel.addSetup(async (c) => {
|
|
@@ -101,7 +101,7 @@ class RabbitMq {
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
async consumeFromExchange(queue, exchange, callback, options) {
|
|
104
|
-
const { limit } = options ? options : 1;
|
|
104
|
+
const { limit } = (options && options.limit) ? options : { limit: 1 };
|
|
105
105
|
const channel = await this.assertChannel();
|
|
106
106
|
await Promise.all([
|
|
107
107
|
this.assertExchange(exchange),
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -112,7 +112,7 @@ class RabbitMq {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
async consume(queue: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any) {
|
|
115
|
-
const { limit } = options ? options : 1;
|
|
115
|
+
const { limit } = (options && options.limit) ? options : { limit: 1 };
|
|
116
116
|
const channel: ChannelWrapper = await this.assertChannel();
|
|
117
117
|
await this.assertQueue(queue);
|
|
118
118
|
return channel.addSetup(async (c: ConfirmChannel) => {
|
|
@@ -124,7 +124,7 @@ class RabbitMq {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
async consumeFromExchange(queue: string, exchange: string, callback: (msg: any, ack: Function, nack: Function) => any, options?: any) {
|
|
127
|
-
const { limit } = options ? options : 1;
|
|
127
|
+
const { limit } = (options && options.limit) ? options : { limit: 1 };
|
|
128
128
|
const channel: ChannelWrapper = await this.assertChannel();
|
|
129
129
|
await Promise.all([
|
|
130
130
|
this.assertExchange(exchange),
|