Skip to content

Commit

Permalink
docs(bullmq-pro): update changelog to v7.19.0 (#2821)
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf authored Oct 12, 2024
1 parent 4b80451 commit 3980e75
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 24 deletions.
17 changes: 17 additions & 0 deletions docs/gitbook/bullmq-pro/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# [7.17.0](https://github.com/taskforcesh/bullmq-pro/compare/v7.16.0...v7.17.0) (2024-10-12)


### Features

* **repeat:** deprecate immediately on job scheduler ([ed047f7](https://github.com/taskforcesh/bullmq/commit/ed047f7ab69ebdb445343b6cb325e90b95ee9dc5))
* **job:** expose priority value ([#2804](https://github.com/taskforcesh/bullmq/issues/2804)) ([9abec3d](https://github.com/taskforcesh/bullmq/commit/9abec3dbc4c69f2496c5ff6b5d724f4d1a5ca62f))
* **job:** add deduplication logic ([#2796](https://github.com/taskforcesh/bullmq/issues/2796)) ([0a4982d](https://github.com/taskforcesh/bullmq/commit/0a4982d05d27c066248290ab9f59349b802d02d5))
* **queue:** add new upsertJobScheduler, getJobSchedulers and removeJobSchedulers methods ([dd6b6b2](https://github.com/taskforcesh/bullmq/commit/dd6b6b2263badd8f29db65d1fa6bcdf5a1e9f6e2))
* **worker-fork:** allow passing fork options ([#2795](https://github.com/taskforcesh/bullmq/issues/2795)) ([f7a4292](https://github.com/taskforcesh/bullmq/commit/f7a4292e064b41236f4489b3d7785a4c599a6435))
* **worker-thread:** allow passing Worker options ([#2791](https://github.com/taskforcesh/bullmq/issues/2791)) ref [#1555](https://github.com/taskforcesh/bullmq/issues/1555) ([6a1f7a9](https://github.com/taskforcesh/bullmq/commit/6a1f7a9f0303561d6ec7b2005ba0227132b89e07))

### Bug Fixes

* **repeat:** also consider startDate when using "every" ([25bbaa8](https://github.com/taskforcesh/bullmq/commit/25bbaa81af87f9944a64bc4fb7e0c76ef223ada4))
* **sandbox:** catch exit errors ([#2800](https://github.com/taskforcesh/bullmq/issues/2800)) ([6babb9e](https://github.com/taskforcesh/bullmq/commit/6babb9e2f355feaf9bd1a8ed229c1001e6de7144))

# [7.16.0](https://github.com/taskforcesh/bullmq-pro/compare/v7.15.4...v7.16.0) (2024-09-24)


Expand Down
23 changes: 17 additions & 6 deletions src/classes/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,21 +398,32 @@ export class Scripts {
return (<any>client).removeJobScheduler(keys.concat(args));
}

protected removeArgs(jobId: string, removeChildren: boolean): (string | number)[] {
const keys: (string | number)[] = ['', 'meta'].map(name =>
this.queue.toKey(name),
);

const args = [jobId, removeChildren ? 1 : 0];

return keys.concat(args);
}

async remove(jobId: string, removeChildren: boolean): Promise<number> {
const client = await this.queue.client;

const keys: (string | number)[] = ['', 'meta'].map(name =>
this.queue.toKey(name),
const args = this.removeArgs(
jobId, removeChildren
);

const result = await (<any>client).removeJob(
keys.concat([jobId, removeChildren ? 1 : 0]),
args,
);

if (result == ErrorCode.JobBelongsToJobScheduler) {
if (result < 0) {
throw this.finishedErrors({
code: ErrorCode.JobBelongsToJobScheduler,
code: result,
jobId,
command: 'remove',
command: 'removeJob',
});
}

Expand Down
12 changes: 0 additions & 12 deletions src/commands/includes/removeDebounceKey.lua

This file was deleted.

12 changes: 12 additions & 0 deletions src/commands/includes/removeDeduplicationKey.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--[[
Function to remove deduplication key.
]]

local function removeDeduplicationKey(prefixKey, jobKey)
local deduplicationId = rcall("HGET", jobKey, "deid")
if deduplicationId then
local deduplicationKey = prefixKey .. "de:" .. deduplicationId
rcall("DEL", deduplicationKey)
end
end

8 changes: 4 additions & 4 deletions src/commands/includes/removeJob.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
]]

-- Includes
--- @include "removeDebounceKey"
--- @include "removeDeduplicationKey"
--- @include "removeJobKeys"
--- @include "removeParentDependencyKey"

local function removeJob(jobId, hard, baseKey, shouldRemoveDebounceKey)
local function removeJob(jobId, hard, baseKey, shouldRemoveDeduplicationKey)
local jobKey = baseKey .. jobId
removeParentDependencyKey(jobKey, hard, nil, baseKey)
if shouldRemoveDebounceKey then
removeDebounceKey(baseKey, jobKey)
if shouldRemoveDeduplicationKey then
removeDeduplicationKey(baseKey, jobKey)
end
removeJobKeys(jobKey)
end
4 changes: 2 additions & 2 deletions src/commands/removeJob-2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local rcall = redis.call
--- @include "includes/destructureJobKey"
--- @include "includes/getOrSetMaxEvents"
--- @include "includes/isLocked"
--- @include "includes/removeDebounceKey"
--- @include "includes/removeDeduplicationKey"
--- @include "includes/removeJobFromAnyState"
--- @include "includes/removeJobKeys"
--- @include "includes/removeParentDependencyKey"
Expand Down Expand Up @@ -67,7 +67,7 @@ local function removeJob(prefix, jobId, parentKey, removeChildren)

local prev = removeJobFromAnyState(prefix, jobId)

removeDebounceKey(prefix, jobKey)
removeDeduplicationKey(prefix, jobKey)
if removeJobKeys(jobKey) > 0 then
local maxEvents = getOrSetMaxEvents(KEYS[2])
rcall("XADD", prefix .. "events", "MAXLEN", "~", maxEvents, "*", "event", "removed", "jobId", jobId, "prev",
Expand Down

0 comments on commit 3980e75

Please sign in to comment.