Skip to content

Commit

Permalink
fix(worker): return minimumBlockTimeout depending on redis version (p…
Browse files Browse the repository at this point in the history
…ython) (#2532)
  • Loading branch information
roggervalf committed Apr 20, 2024
1 parent 333c3e0 commit 83dfb63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/bullmq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def getBlockTimeout(self, block_until: int):
block_timeout = None
block_delay = block_until - int(time.time() * 1000)
if block_delay < self.minimumBlockTimeout * 1000:
block_timeout = minimum_block_timeout
return self.minimumBlockTimeout
else:
block_timeout = block_delay / 1000
# We restrict the maximum block timeout to 10 second to avoid
Expand Down
2 changes: 1 addition & 1 deletion src/classes/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ export class Worker<
const blockDelay = blockUntil - Date.now();
// when we reach the time to get new jobs
if (blockDelay < this.minimumBlockTimeout * 1000) {
blockTimeout = minimumBlockTimeout;
return this.minimumBlockTimeout;
} else {
blockTimeout = blockDelay / 1000;
}
Expand Down

0 comments on commit 83dfb63

Please sign in to comment.