node-resque
Advanced tools
Comparing version 8.2.6 to 8.2.7
@@ -48,2 +48,3 @@ /// <reference types="node" /> | ||
private unwatchIfPossible; | ||
private canWatch; | ||
} |
@@ -209,12 +209,18 @@ "use strict"; | ||
async watchIfPossible(key) { | ||
if (typeof this.connection.redis.watch === "function") { | ||
if (this.canWatch()) | ||
return this.connection.redis.watch(key); | ||
} | ||
} | ||
async unwatchIfPossible() { | ||
if (typeof this.connection.redis.unwatch === "function") { | ||
if (this.canWatch()) | ||
return this.connection.redis.unwatch(); | ||
} | ||
} | ||
canWatch() { | ||
var _a, _b; | ||
if (((_b = (_a = this.connection.redis) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.name) === "RedisMock") | ||
return false; | ||
if (typeof this.connection.redis.unwatch !== "function") | ||
return false; | ||
return true; | ||
} | ||
} | ||
exports.Scheduler = Scheduler; |
@@ -6,3 +6,3 @@ { | ||
"license": "Apache-2.0", | ||
"version": "8.2.6", | ||
"version": "8.2.7", | ||
"homepage": "http://github.com/actionhero/node-resque", | ||
@@ -30,16 +30,16 @@ "repository": { | ||
"dependencies": { | ||
"ioredis": "^4.24.6" | ||
"ioredis": "^4.27.1" | ||
}, | ||
"devDependencies": { | ||
"@types/ioredis": "^4.22.2", | ||
"@types/jest": "^26.0.22", | ||
"@types/node": "^14.14.37", | ||
"ioredis-mock": "^5.4.1", | ||
"@types/ioredis": "^4.26.0", | ||
"@types/jest": "^26.0.23", | ||
"@types/node": "^14.14.41", | ||
"ioredis-mock": "^5.5.4", | ||
"jest": "^26.6.3", | ||
"node-schedule": "^2.0.0", | ||
"prettier": "^2.2.1", | ||
"ts-jest": "^26.5.4", | ||
"ts-jest": "^26.5.5", | ||
"ts-node": "^9.1.1", | ||
"typedoc": "^0.20.34", | ||
"typescript": "^4.2.3" | ||
"typedoc": "^0.20.36", | ||
"typescript": "^4.2.4" | ||
}, | ||
@@ -46,0 +46,0 @@ "jest": { |
@@ -320,12 +320,14 @@ // To read notes about the leader locking scheme, check out: | ||
private async watchIfPossible(key: string) { | ||
if (typeof this.connection.redis.watch === "function") { | ||
return this.connection.redis.watch(key); | ||
} | ||
if (this.canWatch()) return this.connection.redis.watch(key); | ||
} | ||
private async unwatchIfPossible() { | ||
if (typeof this.connection.redis.unwatch === "function") { | ||
return this.connection.redis.unwatch(); | ||
} | ||
if (this.canWatch()) return this.connection.redis.unwatch(); | ||
} | ||
private canWatch() { | ||
if (this.connection.redis?.constructor?.name === "RedisMock") return false; | ||
if (typeof this.connection.redis.unwatch !== "function") return false; | ||
return true; | ||
} | ||
} |
686387
8691
Updatedioredis@^4.27.1