@imqueue/core 2.0.18 → 2.0.22
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/debug_getter.d.ts +9 -0
- package/debug_listener.d.ts +1 -0
- package/package.json +1 -1
- package/src/RedisQueue.js +5 -4
- package/src/redis.d.ts +0 -1
- package/src/redis.js +0 -23
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
package/src/RedisQueue.js
CHANGED
|
@@ -577,11 +577,12 @@ class RedisQueue extends events_1.EventEmitter {
|
|
|
577
577
|
connectionName: this.getChannelName(context.name + '', options.prefix || '', channel),
|
|
578
578
|
retryStrategy: this.retryStrategy(context),
|
|
579
579
|
autoResubscribe: true,
|
|
580
|
-
enableReadyCheck: true,
|
|
581
580
|
enableOfflineQueue: true,
|
|
582
581
|
autoResendUnfulfilledCommands: true,
|
|
582
|
+
offlineQueue: true,
|
|
583
|
+
maxRetriesPerRequest: null,
|
|
583
584
|
});
|
|
584
|
-
context[channel] =
|
|
585
|
+
context[channel] = redis;
|
|
585
586
|
context[channel].__imq = true;
|
|
586
587
|
for (const event of [
|
|
587
588
|
'wait',
|
|
@@ -614,7 +615,7 @@ class RedisQueue extends events_1.EventEmitter {
|
|
|
614
615
|
return null;
|
|
615
616
|
}
|
|
616
617
|
this.verbose('Redis connection error, retrying...');
|
|
617
|
-
return
|
|
618
|
+
return null;
|
|
618
619
|
};
|
|
619
620
|
}
|
|
620
621
|
/**
|
|
@@ -847,7 +848,7 @@ class RedisQueue extends events_1.EventEmitter {
|
|
|
847
848
|
*/
|
|
848
849
|
// istanbul ignore next
|
|
849
850
|
watch() {
|
|
850
|
-
if (!this.watcher || this.watcher.__ready__) {
|
|
851
|
+
if (!this.writer || !this.watcher || this.watcher.__ready__) {
|
|
851
852
|
return this;
|
|
852
853
|
}
|
|
853
854
|
try {
|
package/src/redis.d.ts
CHANGED
package/src/redis.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Redis = void 0;
|
|
4
|
-
exports.makeRedisSafe = makeRedisSafe;
|
|
5
4
|
/*!
|
|
6
5
|
* Extends native redis module to be promise-like
|
|
7
6
|
*
|
|
@@ -28,27 +27,5 @@ exports.makeRedisSafe = makeRedisSafe;
|
|
|
28
27
|
/* tslint:disable */
|
|
29
28
|
const ioredis_1 = require("ioredis");
|
|
30
29
|
exports.Redis = ioredis_1.default;
|
|
31
|
-
// istanbul ignore next
|
|
32
|
-
function makeRedisSafe(redis) {
|
|
33
|
-
return new Proxy(redis, {
|
|
34
|
-
get(target, property, receiver) {
|
|
35
|
-
const original = Reflect.get(target, property, receiver);
|
|
36
|
-
if (typeof original === 'function') {
|
|
37
|
-
return async (...args) => {
|
|
38
|
-
try {
|
|
39
|
-
if (target.status !== 'ready') {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
return await original.apply(target, args);
|
|
43
|
-
}
|
|
44
|
-
catch (err) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
return original;
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
30
|
exports.default = ioredis_1.default;
|
|
54
31
|
//# sourceMappingURL=redis.js.map
|