Skip to content

Commit 18cc843

Browse files
committed
Merge pull request #365 from EverythingMe/fix/mget_error
Fix: when no queries are being run, cleanup job fails with error
2 parents 63274db + 5eba318 commit 18cc843

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

redash/tasks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ def refresh_queries():
171171
def cleanup_tasks():
172172
# in case of cold restart of the workers, there might be jobs that still have their "lock" object, but aren't really
173173
# going to run. this job removes them.
174-
175174
lock_keys = redis_connection.keys("query_hash_job:*") # TODO: use set instead of keys command
175+
if not lock_keys:
176+
return
177+
176178
query_tasks = [QueryTask(job_id=j) for j in redis_connection.mget(lock_keys)]
177179

178180
logger.info("Found %d locks", len(query_tasks))

0 commit comments

Comments
 (0)