Skip to content

Commit

Permalink
Add task completed debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljcollinsuk committed Nov 29, 2024
1 parent 184c6fc commit c8a7052
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions controlpanel/api/tasks/handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ class BaseTaskHandler(CeleryTask):
task_obj = None

def complete(self):
if self.task_obj:
self.task_obj.completed = True
self.task_obj.save()
if not self.task_obj:
return log.warn("No Task object to mark as completed.")

self.task_obj.completed = True
self.task_obj.save()
log.info(f"Task object completed: {self.task_obj.task_id}")

def get_task_obj(self):
task_id = self.request.id
Expand Down

0 comments on commit c8a7052

Please sign in to comment.