bullmq 5.12.12 → 5.12.13

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.
Files changed (46) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +0 -10
  3. package/dist/cjs/classes/queue.js +1 -1
  4. package/dist/cjs/classes/queue.js.map +1 -1
  5. package/dist/cjs/classes/repeat.js +28 -22
  6. package/dist/cjs/classes/repeat.js.map +1 -1
  7. package/dist/cjs/classes/scripts.js +18 -5
  8. package/dist/cjs/classes/scripts.js.map +1 -1
  9. package/dist/cjs/classes/worker.js +3 -1
  10. package/dist/cjs/classes/worker.js.map +1 -1
  11. package/dist/cjs/commands/{addRepeatableJob-1.lua → addRepeatableJob-2.lua} +26 -15
  12. package/dist/cjs/commands/updateRepeatableJobMillis-1.lua +28 -0
  13. package/dist/cjs/scripts/addRepeatableJob-2.js +228 -0
  14. package/dist/cjs/scripts/addRepeatableJob-2.js.map +1 -0
  15. package/dist/cjs/scripts/index.js +2 -1
  16. package/dist/cjs/scripts/index.js.map +1 -1
  17. package/dist/cjs/scripts/updateRepeatableJobMillis-1.js +33 -0
  18. package/dist/cjs/scripts/updateRepeatableJobMillis-1.js.map +1 -0
  19. package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
  20. package/dist/esm/classes/queue.js +1 -1
  21. package/dist/esm/classes/queue.js.map +1 -1
  22. package/dist/esm/classes/repeat.d.ts +3 -1
  23. package/dist/esm/classes/repeat.js +28 -22
  24. package/dist/esm/classes/repeat.js.map +1 -1
  25. package/dist/esm/classes/scripts.d.ts +3 -2
  26. package/dist/esm/classes/scripts.js +18 -5
  27. package/dist/esm/classes/scripts.js.map +1 -1
  28. package/dist/esm/classes/worker.js +3 -1
  29. package/dist/esm/classes/worker.js.map +1 -1
  30. package/dist/esm/commands/{addRepeatableJob-1.lua → addRepeatableJob-2.lua} +26 -15
  31. package/dist/esm/commands/updateRepeatableJobMillis-1.lua +28 -0
  32. package/dist/esm/scripts/addRepeatableJob-2.js +225 -0
  33. package/dist/esm/scripts/addRepeatableJob-2.js.map +1 -0
  34. package/dist/esm/scripts/index.d.ts +2 -1
  35. package/dist/esm/scripts/index.js +2 -1
  36. package/dist/esm/scripts/index.js.map +1 -1
  37. package/dist/esm/scripts/updateRepeatableJobMillis-1.d.ts +5 -0
  38. package/dist/esm/scripts/updateRepeatableJobMillis-1.js +30 -0
  39. package/dist/esm/scripts/updateRepeatableJobMillis-1.js.map +1 -0
  40. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +1 -1
  42. package/dist/cjs/scripts/addRepeatableJob-1.js +0 -67
  43. package/dist/cjs/scripts/addRepeatableJob-1.js.map +0 -1
  44. package/dist/esm/scripts/addRepeatableJob-1.js +0 -64
  45. package/dist/esm/scripts/addRepeatableJob-1.js.map +0 -1
  46. /package/dist/esm/scripts/{addRepeatableJob-1.d.ts → addRepeatableJob-2.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bullmq",
3
- "version": "5.12.12",
3
+ "version": "5.12.13",
4
4
  "description": "Queue for messages and jobs based on Redis",
5
5
  "homepage": "https://bullmq.io/",
6
6
  "main": "./dist/cjs/index.js",
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addRepeatableJob = void 0;
4
- const content = `--[[
5
- Adds a repeatable job
6
- Input:
7
- KEYS[1] 'repeat' key
8
- ARGV[1] next milliseconds
9
- ARGV[2] msgpacked options
10
- [1] name
11
- [2] tz?
12
- [3] patten?
13
- [4] endDate?
14
- [5] every?
15
- ARGV[3] legacy custom key TODO: remove this logic in next breaking change
16
- ARGV[4] custom key
17
- ARGV[5] skipCheckExists
18
- Output:
19
- repeatableKey - OK
20
- ]]
21
- local rcall = redis.call
22
- local repeatKey = KEYS[1]
23
- local nextMilli = ARGV[1]
24
- local legacyCustomKey = ARGV[3]
25
- local customKey = ARGV[4]
26
- local function storeRepeatableJob(repeatKey, customKey, nextMilli, rawOpts)
27
- rcall("ZADD", repeatKey, nextMilli, customKey)
28
- local opts = cmsgpack.unpack(rawOpts)
29
- local optionalValues = {}
30
- if opts['tz'] then
31
- table.insert(optionalValues, "tz")
32
- table.insert(optionalValues, opts['tz'])
33
- end
34
- if opts['pattern'] then
35
- table.insert(optionalValues, "pattern")
36
- table.insert(optionalValues, opts['pattern'])
37
- end
38
- if opts['endDate'] then
39
- table.insert(optionalValues, "endDate")
40
- table.insert(optionalValues, opts['endDate'])
41
- end
42
- if opts['every'] then
43
- table.insert(optionalValues, "every")
44
- table.insert(optionalValues, opts['every'])
45
- end
46
- rcall("HMSET", repeatKey .. ":" .. customKey, "name", opts['name'],
47
- unpack(optionalValues))
48
- return customKey
49
- end
50
- local legacyRepeatableJobExists = rcall("ZSCORE", repeatKey, legacyCustomKey)
51
- if ARGV[5] == '0' or legacyRepeatableJobExists ~= false then
52
- if legacyRepeatableJobExists ~= false then
53
- rcall("ZADD", repeatKey, nextMilli, legacyCustomKey)
54
- return legacyCustomKey
55
- elseif rcall("ZSCORE", repeatKey, customKey) ~= false then
56
- return storeRepeatableJob(repeatKey, customKey, nextMilli, ARGV[2])
57
- end
58
- else
59
- return storeRepeatableJob(repeatKey, customKey, nextMilli, ARGV[2])
60
- end
61
- return ''`;
62
- exports.addRepeatableJob = {
63
- name: 'addRepeatableJob',
64
- content,
65
- keys: 1,
66
- };
67
- //# sourceMappingURL=addRepeatableJob-1.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addRepeatableJob-1.js","sourceRoot":"","sources":["../../../src/scripts/addRepeatableJob-1.ts"],"names":[],"mappings":";;;AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyDN,CAAC;AACE,QAAA,gBAAgB,GAAG;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}
@@ -1,64 +0,0 @@
1
- const content = `--[[
2
- Adds a repeatable job
3
- Input:
4
- KEYS[1] 'repeat' key
5
- ARGV[1] next milliseconds
6
- ARGV[2] msgpacked options
7
- [1] name
8
- [2] tz?
9
- [3] patten?
10
- [4] endDate?
11
- [5] every?
12
- ARGV[3] legacy custom key TODO: remove this logic in next breaking change
13
- ARGV[4] custom key
14
- ARGV[5] skipCheckExists
15
- Output:
16
- repeatableKey - OK
17
- ]]
18
- local rcall = redis.call
19
- local repeatKey = KEYS[1]
20
- local nextMilli = ARGV[1]
21
- local legacyCustomKey = ARGV[3]
22
- local customKey = ARGV[4]
23
- local function storeRepeatableJob(repeatKey, customKey, nextMilli, rawOpts)
24
- rcall("ZADD", repeatKey, nextMilli, customKey)
25
- local opts = cmsgpack.unpack(rawOpts)
26
- local optionalValues = {}
27
- if opts['tz'] then
28
- table.insert(optionalValues, "tz")
29
- table.insert(optionalValues, opts['tz'])
30
- end
31
- if opts['pattern'] then
32
- table.insert(optionalValues, "pattern")
33
- table.insert(optionalValues, opts['pattern'])
34
- end
35
- if opts['endDate'] then
36
- table.insert(optionalValues, "endDate")
37
- table.insert(optionalValues, opts['endDate'])
38
- end
39
- if opts['every'] then
40
- table.insert(optionalValues, "every")
41
- table.insert(optionalValues, opts['every'])
42
- end
43
- rcall("HMSET", repeatKey .. ":" .. customKey, "name", opts['name'],
44
- unpack(optionalValues))
45
- return customKey
46
- end
47
- local legacyRepeatableJobExists = rcall("ZSCORE", repeatKey, legacyCustomKey)
48
- if ARGV[5] == '0' or legacyRepeatableJobExists ~= false then
49
- if legacyRepeatableJobExists ~= false then
50
- rcall("ZADD", repeatKey, nextMilli, legacyCustomKey)
51
- return legacyCustomKey
52
- elseif rcall("ZSCORE", repeatKey, customKey) ~= false then
53
- return storeRepeatableJob(repeatKey, customKey, nextMilli, ARGV[2])
54
- end
55
- else
56
- return storeRepeatableJob(repeatKey, customKey, nextMilli, ARGV[2])
57
- end
58
- return ''`;
59
- export const addRepeatableJob = {
60
- name: 'addRepeatableJob',
61
- content,
62
- keys: 1,
63
- };
64
- //# sourceMappingURL=addRepeatableJob-1.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addRepeatableJob-1.js","sourceRoot":"","sources":["../../../src/scripts/addRepeatableJob-1.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyDN,CAAC;AACX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO;IACP,IAAI,EAAE,CAAC;CACR,CAAC"}