Comparing version 3.25.2 to 3.26.0
@@ -0,1 +1,8 @@ | ||
# [3.26.0](https://github.com/OptimalBits/bull/compare/v3.25.2...v3.26.0) (2021-07-16) | ||
### Features | ||
* **repeatable:** store key in repeat options ([dab0d82](https://github.com/OptimalBits/bull/commit/dab0d8266174f1d25ec914cff8450594d85db511)) | ||
## [3.25.2](https://github.com/OptimalBits/bull/compare/v3.25.1...v3.25.2) (2021-07-16) | ||
@@ -2,0 +9,0 @@ |
@@ -41,38 +41,37 @@ 'use strict'; | ||
const jobId = repeat.jobId ? repeat.jobId + ':' : ':'; | ||
const repeatJobKey = getRepeatKey(name, repeat, jobId); | ||
const repeatKey = getRepeatKey(name, repeat, jobId); | ||
const createNextJob = () => { | ||
return client | ||
.zadd(this.keys.repeat, nextMillis, repeatJobKey) | ||
.then(() => { | ||
// | ||
// Generate unique job id for this iteration. | ||
// | ||
const customId = getRepeatJobId( | ||
name, | ||
jobId, | ||
nextMillis, | ||
md5(repeatJobKey) | ||
); | ||
now = Date.now(); | ||
const delay = nextMillis - now; | ||
return client.zadd(this.keys.repeat, nextMillis, repeatKey).then(() => { | ||
// | ||
// Generate unique job id for this iteration. | ||
// | ||
const customId = getRepeatJobId( | ||
name, | ||
jobId, | ||
nextMillis, | ||
md5(repeatKey) | ||
); | ||
now = Date.now(); | ||
const delay = nextMillis - now; | ||
return Job.create( | ||
this, | ||
name, | ||
data, | ||
_.defaultsDeep( | ||
{ | ||
repeat: { | ||
count: currentCount | ||
}, | ||
jobId: customId, | ||
delay: delay < 0 ? 0 : delay, | ||
timestamp: now, | ||
prevMillis: nextMillis | ||
return Job.create( | ||
this, | ||
name, | ||
data, | ||
_.defaultsDeep( | ||
{ | ||
repeat: { | ||
count: currentCount, | ||
key: repeatKey | ||
}, | ||
opts | ||
) | ||
); | ||
}); | ||
jobId: customId, | ||
delay: delay < 0 ? 0 : delay, | ||
timestamp: now, | ||
prevMillis: nextMillis | ||
}, | ||
opts | ||
) | ||
); | ||
}); | ||
}; | ||
@@ -87,3 +86,3 @@ | ||
return client | ||
.zscore(this.keys.repeat, repeatJobKey) | ||
.zscore(this.keys.repeat, repeatKey) | ||
.then(repeatableExists => { | ||
@@ -90,0 +89,0 @@ // The job could have been deleted since this check |
{ | ||
"name": "bull", | ||
"version": "3.25.2", | ||
"version": "3.26.0", | ||
"description": "Job manager", | ||
@@ -5,0 +5,0 @@ "engines": { |
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
171434
3238