Skip to content

Commit 04b985f

Browse files
authored
Merge pull request #73 from thread/limit-keys-calls-on-startup
Limit impact of reliable backend startup routine on Redis load
2 parents 6ff4b90 + 824a9ba commit 04b985f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_lightweight_queue/backends/reliable_redis.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def startup(self, queue: QueueName) -> None:
5555
# Without this the startup process can end up racing against workers on
5656
# other machines which are validly re-populating their processing queues
5757
# as they work on jobs.
58-
current_processing_queue_keys = set(self.client.keys(pattern))
58+
current_processing_queue_keys = set(self.client.scan_iter(pattern))
5959
expected_processing_queue_keys = set(
6060
self._processing_key(queue, worker_number).encode()
6161
for worker_number in get_worker_numbers(queue)

0 commit comments

Comments
 (0)