bullmq 1.51.0 → 1.51.1

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.
@@ -0,0 +1,12 @@
1
+ --[[
2
+ Functions to destructure job key.
3
+ Just a bit of warning, these functions may be a bit slow and affect performance significantly.
4
+ ]]
5
+
6
+ local getJobIdFromKey = function (jobKey)
7
+ return string.match(jobKey, ".*:(.*)")
8
+ end
9
+
10
+ local getJobKeyPrefix = function (jobKey, jobId)
11
+ return string.sub(jobKey, 0, #jobKey - #jobId)
12
+ end
@@ -0,0 +1,19 @@
1
+ --[[
2
+ Validate and move or add dependencies to parent.
3
+ ]]
4
+
5
+ local function updateParentDepsIfNeeded(parentKey, parentQueueKey, parentDependenciesKey, parentId, jobIdKey, returnvalue )
6
+ local processedSet = parentKey .. ":processed"
7
+ rcall("HSET", processedSet, jobIdKey, returnvalue)
8
+ local activeParent = rcall("ZSCORE", parentQueueKey .. ":waiting-children", parentId)
9
+ if rcall("SCARD", parentDependenciesKey) == 0 and activeParent then
10
+ rcall("ZREM", parentQueueKey .. ":waiting-children", parentId)
11
+ if rcall("HEXISTS", parentQueueKey .. ":meta", "paused") ~= 1 then
12
+ rcall("RPUSH", parentQueueKey .. ":wait", parentId)
13
+ else
14
+ rcall("RPUSH", parentQueueKey .. ":paused", parentId)
15
+ end
16
+ local parentEventStream = parentQueueKey .. ":events"
17
+ rcall("XADD", parentEventStream, "*", "event", "active", "jobId", parentId, "prev", "waiting-children")
18
+ end
19
+ end
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bullmq",
3
- "version": "1.51.0",
3
+ "version": "1.51.1",
4
4
  "description": "Queue for messages and jobs based on Redis",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,8 +18,9 @@
18
18
  "dist"
19
19
  ],
20
20
  "scripts": {
21
- "build": "tsc && yarn copylua",
22
- "copylua": "copyfiles -f ./src/commands/*.lua ./dist/commands",
21
+ "build": "tsc && yarn copy:lua && yarn copy:includes:lua",
22
+ "copy:lua": "copyfiles -f ./src/commands/*.lua ./dist/commands",
23
+ "copy:includes:lua": "copyfiles -f ./src/commands/includes/*.lua ./dist/commands/includes",
23
24
  "coverage": "nyc --reporter=text npm run test",
24
25
  "coveralls": "nyc report --reporter=text-lcov | coveralls",
25
26
  "cm": "git cz",