Skip to content

Commit

Permalink
chore: update python version
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Apr 2, 2024
1 parent c51b976 commit 559e648
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions python/bullmq/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ def __init__(self, prefix: str, queueName: str, redisConnection: RedisConnection
"moveToActive": self.redisClient.register_script(self.getScript("moveToActive-11.lua")),
"moveToDelayed": self.redisClient.register_script(self.getScript("moveToDelayed-7.lua")),
"moveToFinished": self.redisClient.register_script(self.getScript("moveToFinished-14.lua")),
"moveToWaitingChildren": self.redisClient.register_script(self.getScript("moveToWaitingChildren-4.lua")),
"moveToWaitingChildren": self.redisClient.register_script(self.getScript("moveToWaitingChildren-6.lua")),
"obliterate": self.redisClient.register_script(self.getScript("obliterate-2.lua")),
"pause": self.redisClient.register_script(self.getScript("pause-7.lua")),
"promote": self.redisClient.register_script(self.getScript("promote-8.lua")),
"removeJob": self.redisClient.register_script(self.getScript("removeJob-1.lua")),
"removeJob": self.redisClient.register_script(self.getScript("removeJob-2.lua")),
"reprocessJob": self.redisClient.register_script(self.getScript("reprocessJob-7.lua")),
"retryJob": self.redisClient.register_script(self.getScript("retryJob-10.lua")),
"moveJobsToWait": self.redisClient.register_script(self.getScript("moveJobsToWait-7.lua")),
Expand Down Expand Up @@ -171,7 +171,9 @@ def moveToWaitingChildrenArgs(self, job_id, token, opts: dict = {}):
keys = [self.toKey(job_id) + ":lock",
self.keys['active'],
self.keys['waiting-children'],
self.toKey(job_id)]
self.toKey(job_id),
self.keys[''],
self.keys['meta']]
child_key = opts.get("child") if opts else None
args = [token, get_parent_key(child_key) or "", round(time.time() * 1000), job_id,
"1" if opts.get("skipAttempt") else "0"]
Expand Down Expand Up @@ -307,7 +309,7 @@ async def promote(self, job_id: str):
return None

def remove(self, job_id: str, remove_children: bool):
keys = self.getKeys([''])
keys = self.getKeys(['', 'meta'])
args = [job_id, 1 if remove_children else 0]

return self.commands["removeJob"](keys=keys, args=args)
Expand Down
2 changes: 1 addition & 1 deletion src/commands/moveToActive-11.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ promoteDelayedJobs(delayedKey, markerKey, target, KEYS[3], eventStreamKey, ARGV[
if paused then return {0, 0, 0, 0} end

local maxJobs = tonumber(opts['limiter'] and opts['limiter']['max'])
local expireTime = getRateLimitTTL(maxJobs, rateLimiterKey, markerKey)
local expireTime = getRateLimitTTL(maxJobs, rateLimiterKey)

-- Check if we are rate limited first.
if expireTime > 0 then return {0, 0, expireTime, 0} end
Expand Down
2 changes: 1 addition & 1 deletion src/commands/moveToFinished-14.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ if rcall("EXISTS", jobIdKey) == 1 then -- // Make sure job exists

local maxJobs = tonumber(opts['limiter'] and opts['limiter']['max'])
-- Check if we are rate limited first.
local expireTime = getRateLimitTTL(maxJobs, KEYS[6], KEYS[14])
local expireTime = getRateLimitTTL(maxJobs, KEYS[6])

if expireTime > 0 then return {0, 0, expireTime, 0} end

Expand Down

0 comments on commit 559e648

Please sign in to comment.