power-queues 2.1.8 → 2.1.9
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 +5 -7
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +5 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -569,22 +569,20 @@ var PowerQueues = class extends import_power_redis.PowerRedis {
|
|
|
569
569
|
const taskP = { ...task };
|
|
570
570
|
if (!(taskP.attempt >= this.retryCount - 1)) {
|
|
571
571
|
await this.onRetry(err, queueName, taskP);
|
|
572
|
-
await this.addTasks(queueName, [{ ...taskP.payload }], {
|
|
572
|
+
await this.addTasks(queueName, [{ ...taskP.payload, idemKey: taskP.idemKey }], {
|
|
573
573
|
createdAt: taskP.createdAt,
|
|
574
574
|
job: taskP.job,
|
|
575
|
-
attempt: (taskP.attempt || 0) + 1
|
|
576
|
-
idemKey: taskP.idemKey
|
|
575
|
+
attempt: (taskP.attempt || 0) + 1
|
|
577
576
|
});
|
|
578
577
|
} else if (this.logStatus) {
|
|
579
578
|
const dlqKey = queueName + ":dlq";
|
|
580
579
|
const statusKey = `${queueName}:${taskP.job}:`;
|
|
581
580
|
await this.incr(statusKey + "err", this.logStatusTimeout);
|
|
582
581
|
await this.incr(statusKey + "ready", this.logStatusTimeout);
|
|
583
|
-
await this.addTasks(dlqKey, [{ ...taskP.payload }], {
|
|
582
|
+
await this.addTasks(dlqKey, [{ ...taskP.payload, idemKey: taskP.idemKey }], {
|
|
584
583
|
createdAt: taskP.createdAt,
|
|
585
584
|
job: taskP.job,
|
|
586
|
-
attempt: taskP.attempt
|
|
587
|
-
idemKey: taskP.idemKey
|
|
585
|
+
attempt: taskP.attempt
|
|
588
586
|
});
|
|
589
587
|
}
|
|
590
588
|
return await this.onError(err, queueName, { ...taskP, attempt: (taskP.attempt || 0) + 1 });
|
|
@@ -773,7 +771,7 @@ var PowerQueues = class extends import_power_redis.PowerRedis {
|
|
|
773
771
|
payload: JSON.stringify(taskP),
|
|
774
772
|
attempt: Number(opts.attempt || 0),
|
|
775
773
|
job: opts.job ?? (0, import_uuid.v4)(),
|
|
776
|
-
idemKey: String(
|
|
774
|
+
idemKey: String(idemKey || (0, import_uuid.v4)()),
|
|
777
775
|
createdAt
|
|
778
776
|
};
|
|
779
777
|
const reqKeysLength = this.keysLength(entry);
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -549,22 +549,20 @@ var PowerQueues = class extends PowerRedis {
|
|
|
549
549
|
const taskP = { ...task };
|
|
550
550
|
if (!(taskP.attempt >= this.retryCount - 1)) {
|
|
551
551
|
await this.onRetry(err, queueName, taskP);
|
|
552
|
-
await this.addTasks(queueName, [{ ...taskP.payload }], {
|
|
552
|
+
await this.addTasks(queueName, [{ ...taskP.payload, idemKey: taskP.idemKey }], {
|
|
553
553
|
createdAt: taskP.createdAt,
|
|
554
554
|
job: taskP.job,
|
|
555
|
-
attempt: (taskP.attempt || 0) + 1
|
|
556
|
-
idemKey: taskP.idemKey
|
|
555
|
+
attempt: (taskP.attempt || 0) + 1
|
|
557
556
|
});
|
|
558
557
|
} else if (this.logStatus) {
|
|
559
558
|
const dlqKey = queueName + ":dlq";
|
|
560
559
|
const statusKey = `${queueName}:${taskP.job}:`;
|
|
561
560
|
await this.incr(statusKey + "err", this.logStatusTimeout);
|
|
562
561
|
await this.incr(statusKey + "ready", this.logStatusTimeout);
|
|
563
|
-
await this.addTasks(dlqKey, [{ ...taskP.payload }], {
|
|
562
|
+
await this.addTasks(dlqKey, [{ ...taskP.payload, idemKey: taskP.idemKey }], {
|
|
564
563
|
createdAt: taskP.createdAt,
|
|
565
564
|
job: taskP.job,
|
|
566
|
-
attempt: taskP.attempt
|
|
567
|
-
idemKey: taskP.idemKey
|
|
565
|
+
attempt: taskP.attempt
|
|
568
566
|
});
|
|
569
567
|
}
|
|
570
568
|
return await this.onError(err, queueName, { ...taskP, attempt: (taskP.attempt || 0) + 1 });
|
|
@@ -753,7 +751,7 @@ var PowerQueues = class extends PowerRedis {
|
|
|
753
751
|
payload: JSON.stringify(taskP),
|
|
754
752
|
attempt: Number(opts.attempt || 0),
|
|
755
753
|
job: opts.job ?? uuid(),
|
|
756
|
-
idemKey: String(
|
|
754
|
+
idemKey: String(idemKey || uuid()),
|
|
757
755
|
createdAt
|
|
758
756
|
};
|
|
759
757
|
const reqKeysLength = this.keysLength(entry);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "power-queues",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.9",
|
|
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",
|