@unchainedshop/plugins 3.0.1 → 3.0.2
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defaultLogger } from '@unchainedshop/logger';
|
|
2
2
|
import { subscribe } from '@unchainedshop/events';
|
|
3
3
|
import { WorkerEventTypes } from '@unchainedshop/core-worker';
|
|
4
4
|
export const FailedRescheduler = {
|
|
@@ -14,7 +14,7 @@ export const FailedRescheduler = {
|
|
|
14
14
|
const scheduled = workDelayMs > 1000
|
|
15
15
|
? new Date(now.getTime() + workDelayMs * 2)
|
|
16
16
|
: new Date(now.setSeconds(now.getSeconds() + 5));
|
|
17
|
-
|
|
17
|
+
defaultLogger.error(`${FailedRescheduler.key} -> Reschedule failed work ${work._id} ${work.type} for ${scheduled.toISOString()} (in ${Math.round(workDelayMs / 1000)}). Remaining retries: ${work.retries}`);
|
|
18
18
|
const workData = {
|
|
19
19
|
type: work.type,
|
|
20
20
|
priority: work.priority,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FailedRescheduler.js","sourceRoot":"","sources":["../../src/worker/FailedRescheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"FailedRescheduler.js","sourceRoot":"","sources":["../../src/worker/FailedRescheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAkB,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAuB9E,MAAM,CAAC,MAAM,iBAAiB,GAAwC;IACpE,GAAG,EAAE,iCAAiC;IACtC,KAAK,EAAE,yBAAyB;IAChC,OAAO,EAAE,OAAO;IAEhB,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,EAAE,YAAY,EAAE,EAAE;QACxC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CAAC;qBAAM,CAAC;oBACN,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;gBAC9B,CAAC;gBAED,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAChD,CAAC;QACH,CAAC,CAAC;QAEF,OAAO;YACL,KAAK;gBACH,SAAS,CAAO,gBAAgB,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;YACjE,CAAC;YAED,IAAI;gBACF,KAAK;YACP,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defaultLogger } from '@unchainedshop/logger';
|
|
2
2
|
import { subscribe } from '@unchainedshop/events';
|
|
3
3
|
import { Work, WorkData, WorkerEventTypes } from '@unchainedshop/core-worker';
|
|
4
4
|
|
|
@@ -40,7 +40,7 @@ export const FailedRescheduler: IScheduler<FailedReschedulerParams> = {
|
|
|
40
40
|
? new Date(now.getTime() + workDelayMs * 2)
|
|
41
41
|
: new Date(now.setSeconds(now.getSeconds() + 5));
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
defaultLogger.error(
|
|
44
44
|
`${FailedRescheduler.key} -> Reschedule failed work ${work._id} ${
|
|
45
45
|
work.type
|
|
46
46
|
} for ${scheduled.toISOString()} (in ${Math.round(workDelayMs / 1000)}). Remaining retries: ${
|