Skip to content

Commit

Permalink
Clear inactive dataset if the last task was executed
Browse files Browse the repository at this point in the history
  • Loading branch information
catileptic committed Jul 3, 2024
1 parent e0f19ed commit ef315d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions servicelayer/taskqueue.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ def mark_done(self, task: Task):
pipe.set(self.end_key, pack_now())
pipe.set(self.last_update_key, pack_now())
pipe.execute()

status = self.get_status()
if status["running"] == 0 and status["pending"] == 0:
# remove the dataset from active datasets
Expand All @@ -314,6 +315,9 @@ def mark_done(self, task: Task):
# delete stages key
pipe.delete(self.active_stages_key)

pipe.execute()


def mark_for_retry(self, task):
pipe = self.conn.pipeline()
stage_key = self.get_stage_key(task.operation)
Expand Down

0 comments on commit ef315d0

Please sign in to comment.