Skip to content

Commit 83dfb63

Browse files
authored
fix(worker): return minimumBlockTimeout depending on redis version (python) (#2532)
1 parent 333c3e0 commit 83dfb63

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/bullmq/worker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def getBlockTimeout(self, block_until: int):
170170
block_timeout = None
171171
block_delay = block_until - int(time.time() * 1000)
172172
if block_delay < self.minimumBlockTimeout * 1000:
173-
block_timeout = minimum_block_timeout
173+
return self.minimumBlockTimeout
174174
else:
175175
block_timeout = block_delay / 1000
176176
# We restrict the maximum block timeout to 10 second to avoid

src/classes/worker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export class Worker<
660660
const blockDelay = blockUntil - Date.now();
661661
// when we reach the time to get new jobs
662662
if (blockDelay < this.minimumBlockTimeout * 1000) {
663-
blockTimeout = minimumBlockTimeout;
663+
return this.minimumBlockTimeout;
664664
} else {
665665
blockTimeout = blockDelay / 1000;
666666
}

0 commit comments

Comments
 (0)