Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check redis set membership properly #211

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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