bullmq 3.5.3 → 3.5.4
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/commands/includes/removeJobFromAnyState.lua +17 -11
- package/dist/cjs/scripts/removeJob-1.js +17 -11
- package/dist/cjs/scripts/removeJob-1.js.map +1 -1
- package/dist/esm/commands/includes/removeJobFromAnyState.lua +17 -11
- package/dist/esm/scripts/removeJob-1.js +17 -11
- package/dist/esm/scripts/removeJob-1.js.map +1 -1
- package/package.json +1 -1
@@ -6,20 +6,26 @@
|
|
6
6
|
]]
|
7
7
|
|
8
8
|
local function removeJobFromAnyState( prefix, jobId)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
return "
|
13
|
-
elseif rcall("
|
14
|
-
|
15
|
-
elseif rcall("ZREM", prefix .. "waiting-children", jobId) == 1 then
|
9
|
+
-- We start with the ZSCORE checks, since they have O(1) complexity
|
10
|
+
if rcall("ZSCORE", prefix .. "completed", jobId) then
|
11
|
+
rcall("ZREM", prefix .. "completed", jobId)
|
12
|
+
return "completed"
|
13
|
+
elseif rcall("ZSCORE", prefix .. "waiting-children", jobId) then
|
14
|
+
rcall("ZREM", prefix .. "waiting-children", jobId)
|
16
15
|
return "waiting-children"
|
17
|
-
elseif rcall("
|
16
|
+
elseif rcall("ZSCORE", prefix .. "delayed", jobId) then
|
17
|
+
rcall("ZREM", prefix .. "delayed", jobId)
|
18
18
|
return "delayed"
|
19
|
-
elseif rcall("
|
20
|
-
|
21
|
-
elseif rcall("ZREM", prefix .. "failed", jobId) == 1 then
|
19
|
+
elseif rcall("ZSCORE", prefix .. "failed", jobId) then
|
20
|
+
rcall("ZREM", prefix .. "failed", jobId)
|
22
21
|
return "failed"
|
22
|
+
-- We remove only 1 element from the list, since we assume they are not added multiple times
|
23
|
+
elseif rcall("LREM", prefix .. "wait", 1, jobId) == 1 then
|
24
|
+
return "wait"
|
25
|
+
elseif rcall("LREM", prefix .. "paused", 1, jobId) == 1 then
|
26
|
+
return "paused"
|
27
|
+
elseif rcall("LREM", prefix .. "active", 1, jobId) == 1 then
|
28
|
+
return "active"
|
23
29
|
end
|
24
30
|
|
25
31
|
return "unknown"
|
@@ -56,20 +56,26 @@ end
|
|
56
56
|
prev state
|
57
57
|
]]
|
58
58
|
local function removeJobFromAnyState( prefix, jobId)
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
return "
|
63
|
-
elseif rcall("
|
64
|
-
|
65
|
-
elseif rcall("ZREM", prefix .. "waiting-children", jobId) == 1 then
|
59
|
+
-- We start with the ZSCORE checks, since they have O(1) complexity
|
60
|
+
if rcall("ZSCORE", prefix .. "completed", jobId) then
|
61
|
+
rcall("ZREM", prefix .. "completed", jobId)
|
62
|
+
return "completed"
|
63
|
+
elseif rcall("ZSCORE", prefix .. "waiting-children", jobId) then
|
64
|
+
rcall("ZREM", prefix .. "waiting-children", jobId)
|
66
65
|
return "waiting-children"
|
67
|
-
elseif rcall("
|
66
|
+
elseif rcall("ZSCORE", prefix .. "delayed", jobId) then
|
67
|
+
rcall("ZREM", prefix .. "delayed", jobId)
|
68
68
|
return "delayed"
|
69
|
-
elseif rcall("
|
70
|
-
|
71
|
-
elseif rcall("ZREM", prefix .. "failed", jobId) == 1 then
|
69
|
+
elseif rcall("ZSCORE", prefix .. "failed", jobId) then
|
70
|
+
rcall("ZREM", prefix .. "failed", jobId)
|
72
71
|
return "failed"
|
72
|
+
-- We remove only 1 element from the list, since we assume they are not added multiple times
|
73
|
+
elseif rcall("LREM", prefix .. "wait", 1, jobId) == 1 then
|
74
|
+
return "wait"
|
75
|
+
elseif rcall("LREM", prefix .. "paused", 1, jobId) == 1 then
|
76
|
+
return "paused"
|
77
|
+
elseif rcall("LREM", prefix .. "active", 1, jobId) == 1 then
|
78
|
+
return "active"
|
73
79
|
end
|
74
80
|
return "unknown"
|
75
81
|
end
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"removeJob-1.js","sourceRoot":"","sources":["../../../src/scripts/removeJob-1.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"removeJob-1.js","sourceRoot":"","sources":["../../../src/scripts/removeJob-1.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Mf,CAAC;AACW,QAAA,SAAS,GAAG;IACvB,IAAI,EAAE,WAAW;IACjB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|
@@ -6,20 +6,26 @@
|
|
6
6
|
]]
|
7
7
|
|
8
8
|
local function removeJobFromAnyState( prefix, jobId)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
return "
|
13
|
-
elseif rcall("
|
14
|
-
|
15
|
-
elseif rcall("ZREM", prefix .. "waiting-children", jobId) == 1 then
|
9
|
+
-- We start with the ZSCORE checks, since they have O(1) complexity
|
10
|
+
if rcall("ZSCORE", prefix .. "completed", jobId) then
|
11
|
+
rcall("ZREM", prefix .. "completed", jobId)
|
12
|
+
return "completed"
|
13
|
+
elseif rcall("ZSCORE", prefix .. "waiting-children", jobId) then
|
14
|
+
rcall("ZREM", prefix .. "waiting-children", jobId)
|
16
15
|
return "waiting-children"
|
17
|
-
elseif rcall("
|
16
|
+
elseif rcall("ZSCORE", prefix .. "delayed", jobId) then
|
17
|
+
rcall("ZREM", prefix .. "delayed", jobId)
|
18
18
|
return "delayed"
|
19
|
-
elseif rcall("
|
20
|
-
|
21
|
-
elseif rcall("ZREM", prefix .. "failed", jobId) == 1 then
|
19
|
+
elseif rcall("ZSCORE", prefix .. "failed", jobId) then
|
20
|
+
rcall("ZREM", prefix .. "failed", jobId)
|
22
21
|
return "failed"
|
22
|
+
-- We remove only 1 element from the list, since we assume they are not added multiple times
|
23
|
+
elseif rcall("LREM", prefix .. "wait", 1, jobId) == 1 then
|
24
|
+
return "wait"
|
25
|
+
elseif rcall("LREM", prefix .. "paused", 1, jobId) == 1 then
|
26
|
+
return "paused"
|
27
|
+
elseif rcall("LREM", prefix .. "active", 1, jobId) == 1 then
|
28
|
+
return "active"
|
23
29
|
end
|
24
30
|
|
25
31
|
return "unknown"
|
@@ -53,20 +53,26 @@ end
|
|
53
53
|
prev state
|
54
54
|
]]
|
55
55
|
local function removeJobFromAnyState( prefix, jobId)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
return "
|
60
|
-
elseif rcall("
|
61
|
-
|
62
|
-
elseif rcall("ZREM", prefix .. "waiting-children", jobId) == 1 then
|
56
|
+
-- We start with the ZSCORE checks, since they have O(1) complexity
|
57
|
+
if rcall("ZSCORE", prefix .. "completed", jobId) then
|
58
|
+
rcall("ZREM", prefix .. "completed", jobId)
|
59
|
+
return "completed"
|
60
|
+
elseif rcall("ZSCORE", prefix .. "waiting-children", jobId) then
|
61
|
+
rcall("ZREM", prefix .. "waiting-children", jobId)
|
63
62
|
return "waiting-children"
|
64
|
-
elseif rcall("
|
63
|
+
elseif rcall("ZSCORE", prefix .. "delayed", jobId) then
|
64
|
+
rcall("ZREM", prefix .. "delayed", jobId)
|
65
65
|
return "delayed"
|
66
|
-
elseif rcall("
|
67
|
-
|
68
|
-
elseif rcall("ZREM", prefix .. "failed", jobId) == 1 then
|
66
|
+
elseif rcall("ZSCORE", prefix .. "failed", jobId) then
|
67
|
+
rcall("ZREM", prefix .. "failed", jobId)
|
69
68
|
return "failed"
|
69
|
+
-- We remove only 1 element from the list, since we assume they are not added multiple times
|
70
|
+
elseif rcall("LREM", prefix .. "wait", 1, jobId) == 1 then
|
71
|
+
return "wait"
|
72
|
+
elseif rcall("LREM", prefix .. "paused", 1, jobId) == 1 then
|
73
|
+
return "paused"
|
74
|
+
elseif rcall("LREM", prefix .. "active", 1, jobId) == 1 then
|
75
|
+
return "active"
|
70
76
|
end
|
71
77
|
return "unknown"
|
72
78
|
end
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"removeJob-1.js","sourceRoot":"","sources":["../../../src/scripts/removeJob-1.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG
|
1
|
+
{"version":3,"file":"removeJob-1.js","sourceRoot":"","sources":["../../../src/scripts/removeJob-1.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0Mf,CAAC;AACF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,WAAW;IACjB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
|