power-queues 2.1.12 → 2.1.13
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.cjs +4 -9
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +5 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -30,8 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
30
30
|
// src/index.ts
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
|
-
PowerQueues: () => PowerQueues
|
|
34
|
-
wait: () => wait
|
|
33
|
+
PowerQueues: () => PowerQueues
|
|
35
34
|
});
|
|
36
35
|
module.exports = __toCommonJS(index_exports);
|
|
37
36
|
|
|
@@ -276,9 +275,6 @@ var SelectStuck = `
|
|
|
276
275
|
`;
|
|
277
276
|
|
|
278
277
|
// src/PowerQueues.ts
|
|
279
|
-
async function wait(timeout = 0) {
|
|
280
|
-
await new Promise((resolve) => setTimeout(() => resolve(true), timeout));
|
|
281
|
-
}
|
|
282
278
|
var PowerQueues = class extends import_power_redis.PowerRedis {
|
|
283
279
|
constructor() {
|
|
284
280
|
super(...arguments);
|
|
@@ -335,7 +331,7 @@ var PowerQueues = class extends import_power_redis.PowerRedis {
|
|
|
335
331
|
} catch {
|
|
336
332
|
}
|
|
337
333
|
if (!Array.isArray(tasks) || !(tasks.length > 0)) {
|
|
338
|
-
await wait(300);
|
|
334
|
+
await (0, import_power_redis.wait)(300);
|
|
339
335
|
continue;
|
|
340
336
|
}
|
|
341
337
|
try {
|
|
@@ -353,7 +349,7 @@ var PowerQueues = class extends import_power_redis.PowerRedis {
|
|
|
353
349
|
})));
|
|
354
350
|
} catch {
|
|
355
351
|
}
|
|
356
|
-
await wait(300);
|
|
352
|
+
await (0, import_power_redis.wait)(300);
|
|
357
353
|
}
|
|
358
354
|
}
|
|
359
355
|
}
|
|
@@ -870,6 +866,5 @@ var PowerQueues = class extends import_power_redis.PowerRedis {
|
|
|
870
866
|
};
|
|
871
867
|
// Annotate the CommonJS export names for ESM import in node:
|
|
872
868
|
0 && (module.exports = {
|
|
873
|
-
PowerQueues
|
|
874
|
-
wait
|
|
869
|
+
PowerQueues
|
|
875
870
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -35,7 +35,6 @@ type Task = {
|
|
|
35
35
|
attempt: number;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
declare function wait(timeout?: number): Promise<void>;
|
|
39
38
|
declare class PowerQueues extends PowerRedis {
|
|
40
39
|
abort: AbortController;
|
|
41
40
|
redis: IORedisLike;
|
|
@@ -101,4 +100,4 @@ declare class PowerQueues extends PowerRedis {
|
|
|
101
100
|
onRetry(err: any, queueName: string, task: Task): Promise<void>;
|
|
102
101
|
}
|
|
103
102
|
|
|
104
|
-
export { type AddTasksOptions, type Constructor, type IdempotencyKeys, PowerQueues, type SavedScript, type Task
|
|
103
|
+
export { type AddTasksOptions, type Constructor, type IdempotencyKeys, PowerQueues, type SavedScript, type Task };
|
package/dist/index.d.ts
CHANGED
|
@@ -35,7 +35,6 @@ type Task = {
|
|
|
35
35
|
attempt: number;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
declare function wait(timeout?: number): Promise<void>;
|
|
39
38
|
declare class PowerQueues extends PowerRedis {
|
|
40
39
|
abort: AbortController;
|
|
41
40
|
redis: IORedisLike;
|
|
@@ -101,4 +100,4 @@ declare class PowerQueues extends PowerRedis {
|
|
|
101
100
|
onRetry(err: any, queueName: string, task: Task): Promise<void>;
|
|
102
101
|
}
|
|
103
102
|
|
|
104
|
-
export { type AddTasksOptions, type Constructor, type IdempotencyKeys, PowerQueues, type SavedScript, type Task
|
|
103
|
+
export { type AddTasksOptions, type Constructor, type IdempotencyKeys, PowerQueues, type SavedScript, type Task };
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import pLimit from "p-limit";
|
|
3
3
|
import { randomUUID } from "crypto";
|
|
4
4
|
import { setMaxListeners } from "events";
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
PowerRedis,
|
|
7
|
+
wait
|
|
8
|
+
} from "power-redis";
|
|
6
9
|
|
|
7
10
|
// src/scripts.ts
|
|
8
11
|
var XAddBulk = `
|
|
@@ -239,9 +242,6 @@ var SelectStuck = `
|
|
|
239
242
|
`;
|
|
240
243
|
|
|
241
244
|
// src/PowerQueues.ts
|
|
242
|
-
async function wait(timeout = 0) {
|
|
243
|
-
await new Promise((resolve) => setTimeout(() => resolve(true), timeout));
|
|
244
|
-
}
|
|
245
245
|
var PowerQueues = class extends PowerRedis {
|
|
246
246
|
constructor() {
|
|
247
247
|
super(...arguments);
|
|
@@ -832,6 +832,5 @@ var PowerQueues = class extends PowerRedis {
|
|
|
832
832
|
}
|
|
833
833
|
};
|
|
834
834
|
export {
|
|
835
|
-
PowerQueues
|
|
836
|
-
wait
|
|
835
|
+
PowerQueues
|
|
837
836
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "power-queues",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.13",
|
|
4
4
|
"description": "High-performance Redis Streams queue for Node.js with Lua-powered bulk XADD, idempotent workers, heartbeat locks, stuck-task recovery, retries, DLQ, and distributed processing.",
|
|
5
5
|
"author": "ihor-bielchenko",
|
|
6
6
|
"license": "MIT",
|
|
@@ -85,6 +85,6 @@
|
|
|
85
85
|
],
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"p-limit": "^7.3.0",
|
|
88
|
-
"power-redis": "^2.0.
|
|
88
|
+
"power-redis": "^2.0.24"
|
|
89
89
|
}
|
|
90
90
|
}
|