power-queues 2.0.10 → 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 CHANGED
@@ -270,7 +270,7 @@ var PowerQueues = class extends import_power_redis.PowerRedis {
270
270
  this.removeOnExecuted = false;
271
271
  this.executeBatchAtOnce = false;
272
272
  this.executeJobStatus = false;
273
- this.executeJobStatusTtlMs = 300;
273
+ this.executeJobStatusTtlMs = 3e5;
274
274
  this.consumerHost = "host";
275
275
  this.stream = "stream";
276
276
  this.group = "group";
@@ -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 = 5;
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 onExecuted(data) {
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.onExecuted(tasks);
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
- onExecuted(data: Array<[string, any[], number, string, string]>): Promise<void>;
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
- onExecuted(data: Array<[string, any[], number, string, string]>): Promise<void>;
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
@@ -253,7 +253,7 @@ var PowerQueues = class extends PowerRedis {
253
253
  this.removeOnExecuted = false;
254
254
  this.executeBatchAtOnce = false;
255
255
  this.executeJobStatus = false;
256
- this.executeJobStatusTtlMs = 300;
256
+ this.executeJobStatusTtlMs = 3e5;
257
257
  this.consumerHost = "host";
258
258
  this.stream = "stream";
259
259
  this.group = "group";
@@ -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 = 5;
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 onExecuted(data) {
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.onExecuted(tasks);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "power-queues",
3
- "version": "2.0.10",
3
+ "version": "2.0.12",
4
4
  "description": "Base classes for implementing custom queues in redis under high load conditions based on nestjs.",
5
5
  "author": "ihor-bielchenko",
6
6
  "license": "MIT",