Skip to content

Commit 72c2d98

Browse files
committed
Revert "Merge pull request #73 from thread/limit-keys-calls-on-startup"
This reverts commit 04b985f, reversing changes made to 6ff4b90. While using SCAN instead of KEYS is the recommended approach, it turns out that it has worse real-world behaviour in the scenario that the change was intended to make. Specifically the queue start-up times were observed to be much longer while the load on the redis instance was not reduced meaningfully, negatively impacting other clients worse than when KEYS was used.
1 parent d271199 commit 72c2d98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_lightweight_queue/backends/reliable_redis.py

Lines changed: 1 addition & 1 deletion
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.scan_iter(pattern))
58+
current_processing_queue_keys = set(self.client.keys(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)