Skip to content

Commit f8abe19

Browse files
committed
Speed up restart
1 parent 78b726e commit f8abe19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ def new_redis_conn(db=0):
4242
return redis.StrictRedis(db=db, password=password, unix_socket_path=socket)
4343

4444

45-
def get_keys(redis_conn, pattern):
45+
def get_keys(redis_conn, pattern, count=500):
4646
"""
4747
Returns Redis keys matching pattern by iterating the keys space.
4848
"""
4949
keys = []
5050
cursor = 0
5151
while True:
52-
(cursor, partial_keys) = redis_conn.scan(cursor, pattern)
52+
(cursor, partial_keys) = redis_conn.scan(cursor, pattern, count)
5353
keys.extend(partial_keys)
5454
if cursor == 0:
5555
break

0 commit comments

Comments
 (0)