Comparing version 4.12.2 to 4.12.3
@@ -0,1 +1,13 @@ | ||
## [4.12.3](https://github.com/OptimalBits/bull/compare/v4.12.2...v4.12.3) (2024-05-10) | ||
### Bug Fixes | ||
* **job:** validate jobKey in updateProgress and update ([#2730](https://github.com/OptimalBits/bull/issues/2730)) ([6d84156](https://github.com/OptimalBits/bull/commit/6d8415696606d3b7ec891f7fca9ab0508923c321)) | ||
### Performance Improvements | ||
* **scripts:** remove token after moving to wait or delayed ([#2731](https://github.com/OptimalBits/bull/issues/2731)) ([7ee8f74](https://github.com/OptimalBits/bull/commit/7ee8f7430a68492c9ce768e7108443592f49d74c)) | ||
## [4.12.2](https://github.com/OptimalBits/bull/compare/v4.12.1...v4.12.2) (2024-01-17) | ||
@@ -2,0 +14,0 @@ |
@@ -162,9 +162,9 @@ 'use strict'; | ||
Job.prototype.update = function(data) { | ||
Job.prototype.update = async function(data) { | ||
this.data = data; | ||
return this.queue.client.hset( | ||
this.queue.toKey(this.id), | ||
'data', | ||
JSON.stringify(data) | ||
); | ||
const code = await scripts.updateData(this, data); | ||
if (code < 0) { | ||
throw scripts.finishedErrors(code, this.id, 'updateData'); | ||
} | ||
}; | ||
@@ -171,0 +171,0 @@ |
@@ -112,3 +112,6 @@ /** | ||
]) | ||
.then(() => { | ||
.then((code) => { | ||
if (code < 0) { | ||
throw scripts.finishedErrors(code, job.id, 'updateProgress'); | ||
} | ||
queue.emit('progress', job, progress); | ||
@@ -118,2 +121,15 @@ }); | ||
updateData(job, data) { | ||
const queue = job.queue; | ||
const keys = [job.id].map(name => { | ||
return queue.toKey(name); | ||
}); | ||
const dataJson = JSON.stringify(data); | ||
return queue.client | ||
.updateData(keys, [ | ||
dataJson | ||
]); | ||
}, | ||
retryJobsArgs(queue, count) { | ||
@@ -296,3 +312,3 @@ const keys = [ | ||
const keys = _.map(['active', 'delayed', jobId], name => { | ||
const keys = _.map(['active', 'delayed', jobId, 'stalled'], name => { | ||
return queue.toKey(name); | ||
@@ -468,3 +484,3 @@ }); | ||
const keys = _.map( | ||
['active', 'wait', jobId, 'meta-paused', 'paused'], | ||
['active', 'wait', jobId, 'meta-paused', 'paused', 'stalled'], | ||
name => { | ||
@@ -471,0 +487,0 @@ return queue.toKey(name); |
{ | ||
"name": "bull", | ||
"version": "4.12.2", | ||
"version": "4.12.3", | ||
"description": "Job manager", | ||
@@ -61,2 +61,4 @@ "engines": { | ||
"scripts": { | ||
"dc:up": "docker-compose -f docker-compose.yml up -d", | ||
"dc:down": "docker-compose -f docker-compose.yml down", | ||
"pretest": "npm run lint", | ||
@@ -63,0 +65,0 @@ "lint": "eslint lib test *.js", |
@@ -54,2 +54,8 @@ | ||
### 🌟 Rediscover Scale Conference 2024 | ||
Discover the latest in in-memory and real-time data technologies at **Rediscover Scale 2024**. Ideal for engineers, architects, and technical leaders looking to push technological boundaries. Connect with experts and advance your skills at The Foundry SF, San Francisco. | ||
[Learn more and register here!](https://www.rediscoverscale.com/) | ||
### 🛠 Tutorials | ||
@@ -56,0 +62,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
242929
47
4502
531