power-queues 2.0.11 → 2.0.12
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 +3 -3
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -278,7 +278,7 @@ var PowerQueues = class extends import_power_redis.PowerRedis {
|
|
|
278
278
|
this.recoveryStuckTasksTimeoutMs = 6e4;
|
|
279
279
|
this.workerLoopIntervalMs = 5e3;
|
|
280
280
|
this.workerSelectionTimeoutMs = 80;
|
|
281
|
-
this.workerMaxRetries =
|
|
281
|
+
this.workerMaxRetries = 1;
|
|
282
282
|
this.workerClearAttemptsTimeoutMs = 864e5;
|
|
283
283
|
}
|
|
284
284
|
async onSelected(data) {
|
|
@@ -286,7 +286,7 @@ var PowerQueues = class extends import_power_redis.PowerRedis {
|
|
|
286
286
|
}
|
|
287
287
|
async onExecute(id, payload, createdAt, job, key, attempt) {
|
|
288
288
|
}
|
|
289
|
-
async
|
|
289
|
+
async onReady(data) {
|
|
290
290
|
}
|
|
291
291
|
async onSuccess(id, payload, createdAt, job, key) {
|
|
292
292
|
}
|
|
@@ -584,7 +584,7 @@ var PowerQueues = class extends import_power_redis.PowerRedis {
|
|
|
584
584
|
if (this.executeBatchAtOnce && promises.length > 0) {
|
|
585
585
|
await Promise.all(promises);
|
|
586
586
|
}
|
|
587
|
-
await this.
|
|
587
|
+
await this.onReady(tasks);
|
|
588
588
|
if (!(0, import_full_utils.isArrFilled)(result) && contended > tasks.length >> 1) {
|
|
589
589
|
await this.waitAbortable(15 + Math.floor(Math.random() * 35) + Math.min(250, 15 * contended + Math.floor(Math.random() * 40)));
|
|
590
590
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -56,7 +56,7 @@ declare class PowerQueues extends PowerRedis {
|
|
|
56
56
|
readonly workerClearAttemptsTimeoutMs: number;
|
|
57
57
|
onSelected(data: Array<[string, any[], number, string, string]>): Promise<[string, any[], number, string, string][]>;
|
|
58
58
|
onExecute(id: string, payload: any, createdAt: number, job: string, key: string, attempt: number): Promise<void>;
|
|
59
|
-
|
|
59
|
+
onReady(data: Array<[string, any[], number, string, string]>): Promise<void>;
|
|
60
60
|
onSuccess(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
61
61
|
onBatchError(err: any, tasks?: Array<[string, any[], number, string, string]>): Promise<void>;
|
|
62
62
|
onError(err: any, id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ declare class PowerQueues extends PowerRedis {
|
|
|
56
56
|
readonly workerClearAttemptsTimeoutMs: number;
|
|
57
57
|
onSelected(data: Array<[string, any[], number, string, string]>): Promise<[string, any[], number, string, string][]>;
|
|
58
58
|
onExecute(id: string, payload: any, createdAt: number, job: string, key: string, attempt: number): Promise<void>;
|
|
59
|
-
|
|
59
|
+
onReady(data: Array<[string, any[], number, string, string]>): Promise<void>;
|
|
60
60
|
onSuccess(id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
|
61
61
|
onBatchError(err: any, tasks?: Array<[string, any[], number, string, string]>): Promise<void>;
|
|
62
62
|
onError(err: any, id: string, payload: any, createdAt: number, job: string, key: string): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -261,7 +261,7 @@ var PowerQueues = class extends PowerRedis {
|
|
|
261
261
|
this.recoveryStuckTasksTimeoutMs = 6e4;
|
|
262
262
|
this.workerLoopIntervalMs = 5e3;
|
|
263
263
|
this.workerSelectionTimeoutMs = 80;
|
|
264
|
-
this.workerMaxRetries =
|
|
264
|
+
this.workerMaxRetries = 1;
|
|
265
265
|
this.workerClearAttemptsTimeoutMs = 864e5;
|
|
266
266
|
}
|
|
267
267
|
async onSelected(data) {
|
|
@@ -269,7 +269,7 @@ var PowerQueues = class extends PowerRedis {
|
|
|
269
269
|
}
|
|
270
270
|
async onExecute(id, payload, createdAt, job, key, attempt) {
|
|
271
271
|
}
|
|
272
|
-
async
|
|
272
|
+
async onReady(data) {
|
|
273
273
|
}
|
|
274
274
|
async onSuccess(id, payload, createdAt, job, key) {
|
|
275
275
|
}
|
|
@@ -567,7 +567,7 @@ var PowerQueues = class extends PowerRedis {
|
|
|
567
567
|
if (this.executeBatchAtOnce && promises.length > 0) {
|
|
568
568
|
await Promise.all(promises);
|
|
569
569
|
}
|
|
570
|
-
await this.
|
|
570
|
+
await this.onReady(tasks);
|
|
571
571
|
if (!isArrFilled(result) && contended > tasks.length >> 1) {
|
|
572
572
|
await this.waitAbortable(15 + Math.floor(Math.random() * 35) + Math.min(250, 15 * contended + Math.floor(Math.random() * 40)));
|
|
573
573
|
}
|
package/package.json
CHANGED