node-resque
Advanced tools
Comparing version 6.0.5 to 6.0.6
@@ -40,3 +40,3 @@ /// <reference types="node" /> | ||
*/ | ||
queues(): Promise<any>; | ||
queues(): Promise<string[]>; | ||
/** | ||
@@ -70,3 +70,3 @@ * - delete a queue, and all jobs in that queue. | ||
delayedAt(timestamp: number): Promise<{ | ||
tasks: any; | ||
tasks: any[]; | ||
rTimestamp: number; | ||
@@ -78,3 +78,3 @@ }>; | ||
*/ | ||
queued(q: string, start: number, stop: number): Promise<any>; | ||
queued(q: string, start: number, stop: number): Promise<any[]>; | ||
/** | ||
@@ -119,3 +119,3 @@ * - jobsHash is an object with its keys being timestamps, and the vales are arrays of jobs at each time. | ||
*/ | ||
failed(start: number, stop: number): Promise<any>; | ||
failed(start: number, stop: number): Promise<any[]>; | ||
removeFailed(failedJob: ErrorPayload): Promise<number>; | ||
@@ -122,0 +122,0 @@ retryAndRemoveFailed(failedJob: ErrorPayload): Promise<any>; |
@@ -93,3 +93,3 @@ "use strict"; | ||
this.emit("workingTimestamp", timestamp); | ||
await this.enqueueDelayedItemsForTimestamp(timestamp); | ||
await this.enqueueDelayedItemsForTimestamp(parseInt(timestamp)); | ||
return this.poll(); | ||
@@ -137,9 +137,9 @@ } | ||
} | ||
const delted = await this.connection.redis.del(this.masterKey()); | ||
const deleted = await this.connection.redis.del(this.masterKey()); | ||
this.master = false; | ||
return delted === 1 || delted.toString() === "true"; | ||
return deleted === 1 || deleted.toString() === "true"; | ||
} | ||
async nextDelayedTimestamp() { | ||
const time = Math.round(new Date().getTime() / 1000); | ||
const items = await this.connection.redis.zrangebyscore(this.connection.key("delayed_queue_schedule"), "-inf", time, "limit", "0", "1"); | ||
const items = await this.connection.redis.zrangebyscore(this.connection.key("delayed_queue_schedule"), 0, time, "LIMIT", 0, 1); | ||
if (items.length === 0) { | ||
@@ -146,0 +146,0 @@ return; |
@@ -11,2 +11,3 @@ "use strict"; | ||
const set = await this.queueObject.connection.redis.setnx(key, timeout); | ||
//@ts-ignore | ||
if (set === true || set === 1) { | ||
@@ -13,0 +14,0 @@ return true; |
@@ -6,3 +6,3 @@ { | ||
"license": "Apache-2.0", | ||
"version": "6.0.5", | ||
"version": "6.0.6", | ||
"homepage": "http://github.com/actionhero/node-resque", | ||
@@ -30,15 +30,15 @@ "repository": { | ||
"dependencies": { | ||
"@types/ioredis": "^4.0.19", | ||
"@types/jest": "^24.0.23", | ||
"@types/node": "^12.12.7", | ||
"@types/ioredis": "^4.14.2", | ||
"@types/node": "^12.12.17", | ||
"ioredis": "^4.14.1" | ||
}, | ||
"devDependencies": { | ||
"@types/jest": "^24.0.23", | ||
"jest": "^24.9.0", | ||
"node-schedule": "^1.3.2", | ||
"prettier": "^1.19.1", | ||
"ts-jest": "^24.1.0", | ||
"ts-node": "^8.5.0", | ||
"typedoc": "^0.15.1", | ||
"typescript": "^3.7.2" | ||
"ts-jest": "^24.2.0", | ||
"ts-node": "^8.5.4", | ||
"typedoc": "^0.15.4", | ||
"typescript": "^3.7.3" | ||
}, | ||
@@ -45,0 +45,0 @@ "jest": { |
@@ -159,3 +159,3 @@ // To read notes about the master locking scheme, check out: | ||
this.emit("workingTimestamp", timestamp); | ||
await this.enqueueDelayedItemsForTimestamp(timestamp); | ||
await this.enqueueDelayedItemsForTimestamp(parseInt(timestamp)); | ||
return this.poll(); | ||
@@ -221,5 +221,5 @@ } else { | ||
const delted = await this.connection.redis.del(this.masterKey()); | ||
const deleted = await this.connection.redis.del(this.masterKey()); | ||
this.master = false; | ||
return delted === 1 || delted.toString() === "true"; | ||
return deleted === 1 || deleted.toString() === "true"; | ||
} | ||
@@ -231,7 +231,7 @@ | ||
this.connection.key("delayed_queue_schedule"), | ||
"-inf", | ||
0, | ||
time, | ||
"limit", | ||
"0", | ||
"1" | ||
"LIMIT", | ||
0, | ||
1 | ||
); | ||
@@ -238,0 +238,0 @@ if (items.length === 0) { |
@@ -11,2 +11,4 @@ // If a job with the same name, queue, and args is already in the queue, do not enqueue it again | ||
const set = await this.queueObject.connection.redis.setnx(key, timeout); | ||
//@ts-ignore | ||
if (set === true || set === 1) { | ||
@@ -13,0 +15,0 @@ return true; |
640093
3
7540
8
- Removed@types/jest@^24.0.23
- Removed@jest/types@24.9.0(transitive)
- Removed@types/istanbul-lib-coverage@2.0.6(transitive)
- Removed@types/istanbul-lib-report@3.0.3(transitive)
- Removed@types/istanbul-reports@1.1.2(transitive)
- Removed@types/jest@24.9.1(transitive)
- Removed@types/yargs@13.0.12(transitive)
- Removed@types/yargs-parser@21.0.3(transitive)
- Removedansi-regex@4.1.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removeddiff-sequences@24.9.0(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removedjest-diff@24.9.0(transitive)
- Removedjest-get-type@24.9.0(transitive)
- Removedpretty-format@24.9.0(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedsupports-color@5.5.0(transitive)
Updated@types/ioredis@^4.14.2
Updated@types/node@^12.12.17