Skip to content

Commit bfcc5bc

Browse files
author
Florian Perucki
committed
more readable condition
1 parent 04e2e8a commit bfcc5bc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

mrq/basetasks/cleaning.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,11 @@ def run(self, params):
137137
# size() returns the number of queued jobs
138138
size = q.size()
139139

140+
has_job = None
140141
if check_mongo:
141142
has_job = connections.mongodb_jobs.mrq_jobs.find_one({"queue": queue})
142143

143-
if size == 0 and (not check_mongo or not has_job):
144+
if size == 0 and has_job is None:
144145
removed_queues.append(queue)
145146
print("Removing empty queue '%s' from known queues ..." % queue)
146147
if not pretend:

0 commit comments

Comments
 (0)