Browse Source

Save Task.status and Task.result in manager

Ask Solem 16 years ago
parent
commit
5b0cb8f4ff
1 changed files with 5 additions and 3 deletions
  1. 5 3
      celery/managers.py

+ 5 - 3
celery/managers.py

@@ -19,11 +19,13 @@ class TaskManager(models.Manager):
     def delete_expired(self):
         self.get_all_expired().delete()
 
-    def mark_as_done(self, task_id):
+    def mark_as_done(self, task_id, result):
         task, created = self.get_or_create(task_id=task_id, defaults={
-                                            "is_done": True})
+                                            "status": "DONE",
+                                            "result": result})
         if not created:
-            task.is_done = True
+            task.status = "DONE"
+            task.result = result
             task.save()