bullmq 5.52.2 → 5.53.0
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/cjs/classes/child-processor.js +17 -0
- package/dist/cjs/classes/child-processor.js.map +1 -1
- package/dist/cjs/classes/flow-producer.js.map +1 -1
- package/dist/cjs/classes/job.js +15 -3
- package/dist/cjs/classes/job.js.map +1 -1
- package/dist/cjs/classes/sandbox.js +10 -0
- package/dist/cjs/classes/sandbox.js.map +1 -1
- package/dist/cjs/classes/scripts.js +33 -16
- package/dist/cjs/classes/scripts.js.map +1 -1
- package/dist/cjs/commands/includes/moveChildFromDependenciesIfNeeded.lua +2 -4
- package/dist/cjs/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
- package/dist/cjs/commands/includes/moveParentToWait.lua +0 -3
- package/dist/cjs/commands/moveToActive-11.lua +2 -2
- package/dist/cjs/commands/moveToFinished-14.lua +13 -8
- package/dist/cjs/enums/child-command.js +1 -0
- package/dist/cjs/enums/child-command.js.map +1 -1
- package/dist/cjs/enums/error-code.js +2 -1
- package/dist/cjs/enums/error-code.js.map +1 -1
- package/dist/cjs/enums/parent-command.js +1 -0
- package/dist/cjs/enums/parent-command.js.map +1 -1
- package/dist/cjs/interfaces/index.js +1 -0
- package/dist/cjs/interfaces/index.js.map +1 -1
- package/dist/cjs/interfaces/parent-options.js +3 -0
- package/dist/cjs/interfaces/parent-options.js.map +1 -0
- package/dist/cjs/scripts/addDelayedJob-6.js +0 -2
- package/dist/cjs/scripts/addDelayedJob-6.js.map +1 -1
- package/dist/cjs/scripts/addParentJob-4.js +0 -2
- package/dist/cjs/scripts/addParentJob-4.js.map +1 -1
- package/dist/cjs/scripts/addPrioritizedJob-8.js +0 -2
- package/dist/cjs/scripts/addPrioritizedJob-8.js.map +1 -1
- package/dist/cjs/scripts/addStandardJob-8.js +0 -2
- package/dist/cjs/scripts/addStandardJob-8.js.map +1 -1
- package/dist/cjs/scripts/moveStalledJobsToWait-9.js +2 -6
- package/dist/cjs/scripts/moveStalledJobsToWait-9.js.map +1 -1
- package/dist/cjs/scripts/moveToActive-11.js +2 -2
- package/dist/cjs/scripts/moveToFinished-14.js +14 -14
- package/dist/cjs/scripts/moveToWaitingChildren-8.js +2 -6
- package/dist/cjs/scripts/moveToWaitingChildren-8.js.map +1 -1
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/cjs/utils.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/classes/child-processor.js +17 -0
- package/dist/esm/classes/child-processor.js.map +1 -1
- package/dist/esm/classes/flow-producer.d.ts +3 -9
- package/dist/esm/classes/flow-producer.js.map +1 -1
- package/dist/esm/classes/job.d.ts +3 -3
- package/dist/esm/classes/job.js +15 -3
- package/dist/esm/classes/job.js.map +1 -1
- package/dist/esm/classes/sandbox.js +10 -0
- package/dist/esm/classes/sandbox.js.map +1 -1
- package/dist/esm/classes/scripts.d.ts +6 -2
- package/dist/esm/classes/scripts.js +33 -16
- package/dist/esm/classes/scripts.js.map +1 -1
- package/dist/esm/commands/includes/moveChildFromDependenciesIfNeeded.lua +2 -4
- package/dist/esm/commands/includes/{moveJobFromPriorityToActive.lua → moveJobFromPrioritizedToActive.lua} +1 -1
- package/dist/esm/commands/includes/moveParentToWait.lua +0 -3
- package/dist/esm/commands/moveToActive-11.lua +2 -2
- package/dist/esm/commands/moveToFinished-14.lua +13 -8
- package/dist/esm/enums/child-command.d.ts +2 -1
- package/dist/esm/enums/child-command.js +1 -0
- package/dist/esm/enums/child-command.js.map +1 -1
- package/dist/esm/enums/error-code.d.ts +3 -2
- package/dist/esm/enums/error-code.js +2 -1
- package/dist/esm/enums/error-code.js.map +1 -1
- package/dist/esm/enums/parent-command.d.ts +2 -1
- package/dist/esm/enums/parent-command.js +1 -0
- package/dist/esm/enums/parent-command.js.map +1 -1
- package/dist/esm/interfaces/base-job-options.d.ts +3 -9
- package/dist/esm/interfaces/index.d.ts +1 -0
- package/dist/esm/interfaces/index.js +1 -0
- package/dist/esm/interfaces/index.js.map +1 -1
- package/dist/esm/interfaces/minimal-job.d.ts +2 -4
- package/dist/esm/interfaces/parent-options.d.ts +11 -0
- package/dist/esm/interfaces/parent-options.js +2 -0
- package/dist/esm/interfaces/parent-options.js.map +1 -0
- package/dist/esm/interfaces/parent.d.ts +6 -2
- package/dist/esm/scripts/addDelayedJob-6.js +0 -2
- package/dist/esm/scripts/addDelayedJob-6.js.map +1 -1
- package/dist/esm/scripts/addParentJob-4.js +0 -2
- package/dist/esm/scripts/addParentJob-4.js.map +1 -1
- package/dist/esm/scripts/addPrioritizedJob-8.js +0 -2
- package/dist/esm/scripts/addPrioritizedJob-8.js.map +1 -1
- package/dist/esm/scripts/addStandardJob-8.js +0 -2
- package/dist/esm/scripts/addStandardJob-8.js.map +1 -1
- package/dist/esm/scripts/moveStalledJobsToWait-9.js +2 -6
- package/dist/esm/scripts/moveStalledJobsToWait-9.js.map +1 -1
- package/dist/esm/scripts/moveToActive-11.js +2 -2
- package/dist/esm/scripts/moveToFinished-14.js +14 -14
- package/dist/esm/scripts/moveToWaitingChildren-8.js +2 -6
- package/dist/esm/scripts/moveToWaitingChildren-8.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/utils.d.ts +2 -5
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
@@ -4,5 +4,6 @@ export var ChildCommand;
|
|
4
4
|
ChildCommand[ChildCommand["Start"] = 1] = "Start";
|
5
5
|
ChildCommand[ChildCommand["Stop"] = 2] = "Stop";
|
6
6
|
ChildCommand[ChildCommand["GetChildrenValuesResponse"] = 3] = "GetChildrenValuesResponse";
|
7
|
+
ChildCommand[ChildCommand["GetIgnoredChildrenFailuresResponse"] = 4] = "GetIgnoredChildrenFailuresResponse";
|
7
8
|
})(ChildCommand || (ChildCommand = {}));
|
8
9
|
//# sourceMappingURL=child-command.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"child-command.js","sourceRoot":"","sources":["../../../src/enums/child-command.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
1
|
+
{"version":3,"file":"child-command.js","sourceRoot":"","sources":["../../../src/enums/child-command.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,+CAAI,CAAA;IACJ,iDAAK,CAAA;IACL,+CAAI,CAAA;IACJ,yFAAyB,CAAA;IACzB,2GAAkC,CAAA;AACpC,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB"}
|
@@ -2,9 +2,10 @@ export declare enum ErrorCode {
|
|
2
2
|
JobNotExist = -1,
|
3
3
|
JobLockNotExist = -2,
|
4
4
|
JobNotInState = -3,
|
5
|
-
|
5
|
+
JobPendingChildren = -4,
|
6
6
|
ParentJobNotExist = -5,
|
7
7
|
JobLockMismatch = -6,
|
8
8
|
ParentJobCannotBeReplaced = -7,
|
9
|
-
JobBelongsToJobScheduler = -8
|
9
|
+
JobBelongsToJobScheduler = -8,
|
10
|
+
JobFailedChildren = -9
|
10
11
|
}
|
@@ -3,10 +3,11 @@ export var ErrorCode;
|
|
3
3
|
ErrorCode[ErrorCode["JobNotExist"] = -1] = "JobNotExist";
|
4
4
|
ErrorCode[ErrorCode["JobLockNotExist"] = -2] = "JobLockNotExist";
|
5
5
|
ErrorCode[ErrorCode["JobNotInState"] = -3] = "JobNotInState";
|
6
|
-
ErrorCode[ErrorCode["
|
6
|
+
ErrorCode[ErrorCode["JobPendingChildren"] = -4] = "JobPendingChildren";
|
7
7
|
ErrorCode[ErrorCode["ParentJobNotExist"] = -5] = "ParentJobNotExist";
|
8
8
|
ErrorCode[ErrorCode["JobLockMismatch"] = -6] = "JobLockMismatch";
|
9
9
|
ErrorCode[ErrorCode["ParentJobCannotBeReplaced"] = -7] = "ParentJobCannotBeReplaced";
|
10
10
|
ErrorCode[ErrorCode["JobBelongsToJobScheduler"] = -8] = "JobBelongsToJobScheduler";
|
11
|
+
ErrorCode[ErrorCode["JobFailedChildren"] = -9] = "JobFailedChildren";
|
11
12
|
})(ErrorCode || (ErrorCode = {}));
|
12
13
|
//# sourceMappingURL=error-code.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"error-code.js","sourceRoot":"","sources":["../../../src/enums/error-code.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
1
|
+
{"version":3,"file":"error-code.js","sourceRoot":"","sources":["../../../src/enums/error-code.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SAUX;AAVD,WAAY,SAAS;IACnB,wDAAgB,CAAA;IAChB,gEAAoB,CAAA;IACpB,4DAAkB,CAAA;IAClB,sEAAuB,CAAA;IACvB,oEAAsB,CAAA;IACtB,gEAAoB,CAAA;IACpB,oFAA8B,CAAA;IAC9B,kFAA6B,CAAA;IAC7B,oEAAsB,CAAA;AACxB,CAAC,EAVW,SAAS,KAAT,SAAS,QAUpB"}
|
@@ -10,5 +10,6 @@ export var ParentCommand;
|
|
10
10
|
ParentCommand[ParentCommand["Progress"] = 7] = "Progress";
|
11
11
|
ParentCommand[ParentCommand["Update"] = 8] = "Update";
|
12
12
|
ParentCommand[ParentCommand["GetChildrenValues"] = 9] = "GetChildrenValues";
|
13
|
+
ParentCommand[ParentCommand["GetIgnoredChildrenFailures"] = 10] = "GetIgnoredChildrenFailures";
|
13
14
|
})(ParentCommand || (ParentCommand = {}));
|
14
15
|
//# sourceMappingURL=parent-command.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"parent-command.js","sourceRoot":"","sources":["../../../src/enums/parent-command.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
1
|
+
{"version":3,"file":"parent-command.js","sourceRoot":"","sources":["../../../src/enums/parent-command.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aAYX;AAZD,WAAY,aAAa;IACvB,2DAAS,CAAA;IACT,mDAAK,CAAA;IACL,qDAAM,CAAA;IACN,6DAAU,CAAA;IACV,mEAAa,CAAA;IACb,+CAAG,CAAA;IACH,mEAAa,CAAA;IACb,yDAAQ,CAAA;IACR,qDAAM,CAAA;IACN,2EAAiB,CAAA;IACjB,8FAA0B,CAAA;AAC5B,CAAC,EAZW,aAAa,KAAb,aAAa,QAYxB"}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { BackoffOptions } from './backoff-options';
|
2
2
|
import { KeepJobs } from './keep-jobs';
|
3
|
+
import { ParentOptions } from './parent-options';
|
3
4
|
import { RepeatOptions } from './repeat-options';
|
4
5
|
export interface DefaultJobOptions {
|
5
6
|
/**
|
@@ -83,16 +84,9 @@ export interface BaseJobOptions extends DefaultJobOptions {
|
|
83
84
|
*/
|
84
85
|
jobId?: string;
|
85
86
|
/**
|
86
|
-
*
|
87
|
+
* Parent options
|
87
88
|
*/
|
88
|
-
parent?:
|
89
|
-
id: string;
|
90
|
-
/**
|
91
|
-
* It includes the prefix, the namespace separator :, and queue name.
|
92
|
-
* @see https://www.gnu.org/software/gawk/manual/html_node/Qualified-Names.html
|
93
|
-
*/
|
94
|
-
queue: string;
|
95
|
-
};
|
89
|
+
parent?: ParentOptions;
|
96
90
|
/**
|
97
91
|
* Internal property used by repeatable jobs.
|
98
92
|
*/
|
@@ -14,6 +14,7 @@ export * from './metrics';
|
|
14
14
|
export * from './minimal-job';
|
15
15
|
export * from './parent-message';
|
16
16
|
export * from './parent';
|
17
|
+
export * from './parent-options';
|
17
18
|
export * from './queue-options';
|
18
19
|
export * from './rate-limiter-options';
|
19
20
|
export * from './redis-options';
|
@@ -14,6 +14,7 @@ export * from './metrics';
|
|
14
14
|
export * from './minimal-job';
|
15
15
|
export * from './parent-message';
|
16
16
|
export * from './parent';
|
17
|
+
export * from './parent-options';
|
17
18
|
export * from './queue-options';
|
18
19
|
export * from './rate-limiter-options';
|
19
20
|
export * from './redis-options';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { JobsOptions, JobJsonSandbox, JobProgress } from '../types';
|
2
2
|
import { JobJson } from './job-json';
|
3
3
|
import { ParentKeys } from './parent';
|
4
|
+
import { ParentOptions } from './parent-options';
|
4
5
|
export type BulkJobOptions = Omit<JobsOptions, 'repeat'>;
|
5
6
|
export interface MoveToDelayedOpts {
|
6
7
|
skipAttempt?: boolean;
|
@@ -10,10 +11,7 @@ export interface RetryJobOpts {
|
|
10
11
|
fieldsToUpdate?: Record<string, any>;
|
11
12
|
}
|
12
13
|
export interface MoveToWaitingChildrenOpts {
|
13
|
-
child?:
|
14
|
-
id: string;
|
15
|
-
queue: string;
|
16
|
-
};
|
14
|
+
child?: ParentOptions;
|
17
15
|
}
|
18
16
|
export interface DependencyOpts {
|
19
17
|
/**
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export type ParentOptions = {
|
2
|
+
/**
|
3
|
+
* Parent identifier.
|
4
|
+
*/
|
5
|
+
id: string;
|
6
|
+
/**
|
7
|
+
* It includes the prefix, the namespace separator :, and queue name.
|
8
|
+
* @see {@link https://www.gnu.org/software/gawk/manual/html_node/Qualified-Names.html}
|
9
|
+
*/
|
10
|
+
queue: string;
|
11
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parent-options.js","sourceRoot":"","sources":["../../../src/interfaces/parent-options.ts"],"names":[],"mappings":""}
|
@@ -10,10 +10,14 @@ export interface Parent<T> {
|
|
10
10
|
opts?: JobsOptions;
|
11
11
|
}
|
12
12
|
export interface ParentKeys {
|
13
|
-
id
|
13
|
+
id?: string;
|
14
14
|
queueKey: string;
|
15
|
+
fpof?: boolean;
|
16
|
+
rdof?: boolean;
|
17
|
+
idof?: boolean;
|
18
|
+
cpof?: boolean;
|
15
19
|
}
|
16
|
-
export type
|
20
|
+
export type ParentKeyOpts = {
|
17
21
|
waitChildrenKey?: string;
|
18
22
|
parentDependenciesKey?: string;
|
19
23
|
parentKey?: string;
|
@@ -249,8 +249,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
|
|
249
249
|
local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
|
250
250
|
local priority = tonumber(jobAttributes[1]) or 0
|
251
251
|
local delay = tonumber(jobAttributes[2]) or 0
|
252
|
-
-- ignore dependencies if any left
|
253
|
-
rcall("HSET", parentKey, "igdp", 1)
|
254
252
|
if delay > 0 then
|
255
253
|
local delayedTimestamp = tonumber(timestamp) + delay
|
256
254
|
local score = delayedTimestamp * 0x1000
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addDelayedJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addDelayedJob-6.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"addDelayedJob-6.js","sourceRoot":"","sources":["../../../src/scripts/addDelayedJob-6.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyYf,CAAC;AACF,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI,EAAE,eAAe;IACrB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -205,8 +205,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
|
|
205
205
|
local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
|
206
206
|
local priority = tonumber(jobAttributes[1]) or 0
|
207
207
|
local delay = tonumber(jobAttributes[2]) or 0
|
208
|
-
-- ignore dependencies if any left
|
209
|
-
rcall("HSET", parentKey, "igdp", 1)
|
210
208
|
if delay > 0 then
|
211
209
|
local delayedTimestamp = tonumber(timestamp) + delay
|
212
210
|
local score = delayedTimestamp * 0x1000
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addParentJob-4.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-4.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"addParentJob-4.js","sourceRoot":"","sources":["../../../src/scripts/addParentJob-4.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgWf,CAAC;AACF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,cAAc;IACpB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -242,8 +242,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
|
|
242
242
|
local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
|
243
243
|
local priority = tonumber(jobAttributes[1]) or 0
|
244
244
|
local delay = tonumber(jobAttributes[2]) or 0
|
245
|
-
-- ignore dependencies if any left
|
246
|
-
rcall("HSET", parentKey, "igdp", 1)
|
247
245
|
if delay > 0 then
|
248
246
|
local delayedTimestamp = tonumber(timestamp) + delay
|
249
247
|
local score = delayedTimestamp * 0x1000
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addPrioritizedJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addPrioritizedJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"addPrioritizedJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addPrioritizedJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Wf,CAAC;AACF,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,IAAI,EAAE,mBAAmB;IACzB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -215,8 +215,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
|
|
215
215
|
local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
|
216
216
|
local priority = tonumber(jobAttributes[1]) or 0
|
217
217
|
local delay = tonumber(jobAttributes[2]) or 0
|
218
|
-
-- ignore dependencies if any left
|
219
|
-
rcall("HSET", parentKey, "igdp", 1)
|
220
218
|
if delay > 0 then
|
221
219
|
local delayedTimestamp = tonumber(timestamp) + delay
|
222
220
|
local score = delayedTimestamp * 0x1000
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addStandardJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addStandardJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"addStandardJob-8.js","sourceRoot":"","sources":["../../../src/scripts/addStandardJob-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8Wf,CAAC;AACF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,IAAI,EAAE,gBAAgB;IACtB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -154,8 +154,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
|
|
154
154
|
local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
|
155
155
|
local priority = tonumber(jobAttributes[1]) or 0
|
156
156
|
local delay = tonumber(jobAttributes[2]) or 0
|
157
|
-
-- ignore dependencies if any left
|
158
|
-
rcall("HSET", parentKey, "igdp", 1)
|
159
157
|
if delay > 0 then
|
160
158
|
local delayedTimestamp = tonumber(timestamp) + delay
|
161
159
|
local score = delayedTimestamp * 0x1000
|
@@ -369,9 +367,7 @@ local function removeJobsOnFail(queueKeyPrefix, failedKey, jobId, opts, timestam
|
|
369
367
|
end
|
370
368
|
end
|
371
369
|
end
|
372
|
-
local moveParentToFailedIfNeeded
|
373
|
-
local moveChildFromDependenciesIfNeeded
|
374
|
-
moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
|
370
|
+
local moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
|
375
371
|
if rcall("EXISTS", parentKey) == 1 then
|
376
372
|
local parentWaitingChildrenKey = parentQueueKey .. ":waiting-children"
|
377
373
|
local parentDelayedKey = parentQueueKey .. ":delayed"
|
@@ -401,7 +397,7 @@ moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobI
|
|
401
397
|
end
|
402
398
|
end
|
403
399
|
end
|
404
|
-
moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
|
400
|
+
local moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
|
405
401
|
if rawParentData then
|
406
402
|
local parentData = cjson.decode(rawParentData)
|
407
403
|
local parentKey = parentData['queueKey'] .. ':' .. parentData['id']
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"moveStalledJobsToWait-9.js","sourceRoot":"","sources":["../../../src/scripts/moveStalledJobsToWait-9.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"moveStalledJobsToWait-9.js","sourceRoot":"","sources":["../../../src/scripts/moveStalledJobsToWait-9.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyiBf,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -86,7 +86,7 @@ end
|
|
86
86
|
--[[
|
87
87
|
Function to move job from prioritized state to active.
|
88
88
|
]]
|
89
|
-
local function
|
89
|
+
local function moveJobFromPrioritizedToActive(priorityKey, activeKey, priorityCounterKey)
|
90
90
|
local prioritizedJob = rcall("ZPOPMIN", priorityKey)
|
91
91
|
if #prioritizedJob > 0 then
|
92
92
|
rcall("LPUSH", activeKey, prioritizedJob[1])
|
@@ -219,7 +219,7 @@ if jobId then
|
|
219
219
|
return prepareJobForProcessing(ARGV[1], rateLimiterKey, eventStreamKey, jobId, ARGV[2],
|
220
220
|
maxJobs, markerKey, opts)
|
221
221
|
else
|
222
|
-
jobId =
|
222
|
+
jobId = moveJobFromPrioritizedToActive(KEYS[3], activeKey, KEYS[10])
|
223
223
|
if jobId then
|
224
224
|
return prepareJobForProcessing(ARGV[1], rateLimiterKey, eventStreamKey, jobId, ARGV[2],
|
225
225
|
maxJobs, markerKey, opts)
|
@@ -43,8 +43,9 @@ const content = `--[[
|
|
43
43
|
-1 Missing key.
|
44
44
|
-2 Missing lock.
|
45
45
|
-3 Job not in active set
|
46
|
-
-4 Job has pending
|
46
|
+
-4 Job has pending children
|
47
47
|
-6 Lock is not owned by this client
|
48
|
+
-9 Job has failed children
|
48
49
|
Events:
|
49
50
|
'completed/failed'
|
50
51
|
]]
|
@@ -154,7 +155,7 @@ end
|
|
154
155
|
--[[
|
155
156
|
Function to move job from prioritized state to active.
|
156
157
|
]]
|
157
|
-
local function
|
158
|
+
local function moveJobFromPrioritizedToActive(priorityKey, activeKey, priorityCounterKey)
|
158
159
|
local prioritizedJob = rcall("ZPOPMIN", priorityKey)
|
159
160
|
if #prioritizedJob > 0 then
|
160
161
|
rcall("LPUSH", activeKey, prioritizedJob[1])
|
@@ -250,8 +251,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
|
|
250
251
|
local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
|
251
252
|
local priority = tonumber(jobAttributes[1]) or 0
|
252
253
|
local delay = tonumber(jobAttributes[2]) or 0
|
253
|
-
-- ignore dependencies if any left
|
254
|
-
rcall("HSET", parentKey, "igdp", 1)
|
255
254
|
if delay > 0 then
|
256
255
|
local delayedTimestamp = tonumber(timestamp) + delay
|
257
256
|
local score = delayedTimestamp * 0x1000
|
@@ -465,9 +464,7 @@ local function removeJobsOnFail(queueKeyPrefix, failedKey, jobId, opts, timestam
|
|
465
464
|
end
|
466
465
|
end
|
467
466
|
end
|
468
|
-
local moveParentToFailedIfNeeded
|
469
|
-
local moveChildFromDependenciesIfNeeded
|
470
|
-
moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
|
467
|
+
local moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
|
471
468
|
if rcall("EXISTS", parentKey) == 1 then
|
472
469
|
local parentWaitingChildrenKey = parentQueueKey .. ":waiting-children"
|
473
470
|
local parentDelayedKey = parentQueueKey .. ":delayed"
|
@@ -497,7 +494,7 @@ moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobI
|
|
497
494
|
end
|
498
495
|
end
|
499
496
|
end
|
500
|
-
moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
|
497
|
+
local moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
|
501
498
|
if rawParentData then
|
502
499
|
local parentData = cjson.decode(rawParentData)
|
503
500
|
local parentKey = parentData['queueKey'] .. ':' .. parentData['id']
|
@@ -688,10 +685,13 @@ local jobIdKey = KEYS[12]
|
|
688
685
|
if rcall("EXISTS", jobIdKey) == 1 then -- Make sure job exists
|
689
686
|
-- Make sure it does not have pending dependencies
|
690
687
|
-- It must happen before removing lock
|
691
|
-
if ARGV[5] == "completed"
|
692
|
-
|
693
|
-
|
694
|
-
|
688
|
+
if ARGV[5] == "completed" then
|
689
|
+
if rcall("SCARD", jobIdKey .. ":dependencies") ~= 0 then
|
690
|
+
return -4
|
691
|
+
end
|
692
|
+
if rcall("ZCARD", jobIdKey .. ":unsuccessful") ~= 0 then
|
693
|
+
return -9
|
694
|
+
end
|
695
695
|
end
|
696
696
|
local opts = cmsgpack.unpack(ARGV[8])
|
697
697
|
local token = opts['token']
|
@@ -810,7 +810,7 @@ if rcall("EXISTS", jobIdKey) == 1 then -- Make sure job exists
|
|
810
810
|
-- If jobId is special ID 0:delay (delay greater than 0), then there is no job to process
|
811
811
|
-- but if ID is 0:0, then there is at least 1 prioritized job to process
|
812
812
|
if jobId == "0:0" then
|
813
|
-
jobId =
|
813
|
+
jobId = moveJobFromPrioritizedToActive(KEYS[3], KEYS[2], KEYS[10])
|
814
814
|
return prepareJobForProcessing(prefix, KEYS[6], eventStreamKey, jobId, timestamp, maxJobs,
|
815
815
|
markerKey, opts)
|
816
816
|
end
|
@@ -819,7 +819,7 @@ if rcall("EXISTS", jobIdKey) == 1 then -- Make sure job exists
|
|
819
819
|
opts)
|
820
820
|
end
|
821
821
|
else
|
822
|
-
jobId =
|
822
|
+
jobId = moveJobFromPrioritizedToActive(KEYS[3], KEYS[2], KEYS[10])
|
823
823
|
if jobId then
|
824
824
|
return prepareJobForProcessing(prefix, KEYS[6], eventStreamKey, jobId, timestamp, maxJobs, markerKey,
|
825
825
|
opts)
|
@@ -151,8 +151,6 @@ local function moveParentToWait(parentQueueKey, parentKey, parentId, timestamp)
|
|
151
151
|
local jobAttributes = rcall("HMGET", parentKey, "priority", "delay")
|
152
152
|
local priority = tonumber(jobAttributes[1]) or 0
|
153
153
|
local delay = tonumber(jobAttributes[2]) or 0
|
154
|
-
-- ignore dependencies if any left
|
155
|
-
rcall("HSET", parentKey, "igdp", 1)
|
156
154
|
if delay > 0 then
|
157
155
|
local delayedTimestamp = tonumber(timestamp) + delay
|
158
156
|
local score = delayedTimestamp * 0x1000
|
@@ -366,9 +364,7 @@ local function removeJobsOnFail(queueKeyPrefix, failedKey, jobId, opts, timestam
|
|
366
364
|
end
|
367
365
|
end
|
368
366
|
end
|
369
|
-
local moveParentToFailedIfNeeded
|
370
|
-
local moveChildFromDependenciesIfNeeded
|
371
|
-
moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
|
367
|
+
local moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobIdKey, timestamp)
|
372
368
|
if rcall("EXISTS", parentKey) == 1 then
|
373
369
|
local parentWaitingChildrenKey = parentQueueKey .. ":waiting-children"
|
374
370
|
local parentDelayedKey = parentQueueKey .. ":delayed"
|
@@ -398,7 +394,7 @@ moveParentToFailedIfNeeded = function (parentQueueKey, parentKey, parentId, jobI
|
|
398
394
|
end
|
399
395
|
end
|
400
396
|
end
|
401
|
-
moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
|
397
|
+
local moveChildFromDependenciesIfNeeded = function (rawParentData, childKey, failedReason, timestamp)
|
402
398
|
if rawParentData then
|
403
399
|
local parentData = cjson.decode(rawParentData)
|
404
400
|
local parentKey = parentData['queueKey'] .. ':' .. parentData['id']
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"moveToWaitingChildren-8.js","sourceRoot":"","sources":["../../../src/scripts/moveToWaitingChildren-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"moveToWaitingChildren-8.js","sourceRoot":"","sources":["../../../src/scripts/moveToWaitingChildren-8.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAugBf,CAAC;AACF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,uBAAuB;IAC7B,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|