Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
neob91-close committed Nov 30, 2022
1 parent 8586fe7 commit 6596f01
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tasktiger/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,12 @@ def _refresh_queue_set(self):
queued_key = self._key(QUEUED)
ignored_key = self._ignored_queues_key()

if not ignored_key:
self._queue_set = set(
self._filter_queues(self.connection.smembers(queued_key))
)
return

queues = self.connection.sdiff(queued_key, ignored_key)
self._queue_set = set(self._filter_queues(queues))

Expand All @@ -1168,12 +1174,15 @@ def _refresh_queue_set(self):
self.connection.sinterstore(ignored_key, ignored_key, queued_key)

def _ignored_queues_key(self):
signature = ",".join(
signature = [
*sorted(self.only_queues),
*sorted(f"-{queue}" for queue in self.exclude_queues),
)
]

if signature:
return self._key(IGNORED, ",".join(signature))

return self._key(IGNORED, signature)
return None

def run(self, once=False, force_once=False):
"""
Expand Down

0 comments on commit 6596f01

Please sign in to comment.