Skip to content

Commit

Permalink
refactor(job-scheduler): move arg as a key in updateJobScheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Jan 12, 2025
1 parent ec03f8f commit d327bb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/classes/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ export class Scripts {
queueKeys.delayed,
queueKeys.events,
queueKeys.repeat,
producerId ? this.queue.toKey(producerId) : '',
];

const args = [
Expand All @@ -377,7 +378,6 @@ export class Scripts {
pack(delayedJobOpts),
Date.now(),
queueKeys[''],
producerId ? this.queue.toKey(producerId) : '',
producerId,
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
KEYS[4] 'delayed'
KEYS[5] events stream key
KEYS[6] 'repeat' key
KEYS[7] producer key
ARGV[1] next milliseconds
ARGV[2] jobs scheduler id
ARGV[3] msgpacked delayed opts
ARGV[4] timestamp
ARGV[5] prefix key
ARGV[6] producer key
ARGV[7] producer id
ARGV[6] producer id
Output:
next delayed job id - OK
Expand All @@ -27,7 +27,7 @@ local timestamp = ARGV[4]
local nextMillis = ARGV[1]
local jobSchedulerId = ARGV[2]
local prefixKey = ARGV[5]
local producerId = ARGV[7]
local producerId = ARGV[6]

-- Includes
--- @include "includes/addDelayedJob"
Expand Down Expand Up @@ -58,8 +58,8 @@ if prevMillis ~= false then
addDelayedJob(nextDelayedJobKey, nextDelayedJobId, delayedKey, eventsKey, schedulerAttributes[1],
schedulerAttributes[2] or "{}", delayedOpts, timestamp, jobSchedulerId, maxEvents, KEYS[1], nil, nil)

if ARGV[6] ~= "" then
rcall("HSET", ARGV[6], "nrjid", nextDelayedJobId)
if KEYS[7] ~= "" then
rcall("HSET", KEYS[7], "nrjid", nextDelayedJobId)
end

return nextDelayedJobId .. "" -- convert to string
Expand Down

0 comments on commit d327bb4

Please sign in to comment.