We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 78b726e commit f8abe19Copy full SHA for f8abe19
utils.py
@@ -42,14 +42,14 @@ def new_redis_conn(db=0):
42
return redis.StrictRedis(db=db, password=password, unix_socket_path=socket)
43
44
45
-def get_keys(redis_conn, pattern):
+def get_keys(redis_conn, pattern, count=500):
46
"""
47
Returns Redis keys matching pattern by iterating the keys space.
48
49
keys = []
50
cursor = 0
51
while True:
52
- (cursor, partial_keys) = redis_conn.scan(cursor, pattern)
+ (cursor, partial_keys) = redis_conn.scan(cursor, pattern, count)
53
keys.extend(partial_keys)
54
if cursor == 0:
55
break
0 commit comments