Skip to content

Commit

Permalink
bugfix: check redis set membership properly
Browse files Browse the repository at this point in the history
  • Loading branch information
stchris committed Nov 23, 2024
1 parent 04bbad5 commit 71f8145
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions servicelayer/taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,14 @@ def is_task_tracked(self, task: Task):

# A task is considered tracked if
# the dataset is in the list of active datasets
if dataset not in self.conn.smembers(self.key):
if not self.conn.sismember(self.key, dataset):
tracked = False
# and the stage is in the list of active stages
elif stage not in self.conn.smembers(self.active_stages_key):
elif not self.conn.sismember(self.active_stages_key, stage):
tracked = False
# and the task_id is in the list of task_ids per stage
elif task_id not in self.conn.smembers(
make_key(PREFIX, "qds", self.name, stage)
elif not self.conn.sismember(
make_key(PREFIX, "qds", self.name, stage), task_id
):
tracked = False

Expand Down

0 comments on commit 71f8145

Please sign in to comment.