Browse Source

Rest of result backends must handle encoded exception

Ask Solem 10 years ago
parent
commit
e5ff4e5265
3 changed files with 5 additions and 4 deletions
  1. 2 2
      celery/backends/cassandra.py
  2. 2 2
      celery/backends/mongodb.py
  3. 1 0
      funtests/stress/stress/templates.py

+ 2 - 2
celery/backends/cassandra.py

@@ -170,14 +170,14 @@ class CassandraBackend(BaseBackend):
                     meta['task_id'] = task_id
                 else:
                     obj = cf.get(task_id)
-                    meta = {
+                    meta = self.meta_from_decoded({
                         'task_id': task_id,
                         'status': obj['status'],
                         'result': self.decode(obj['result']),
                         'date_done': obj['date_done'],
                         'traceback': self.decode(obj['traceback']),
                         'children': self.decode(obj['children']),
-                    }
+                    })
             except (KeyError, pycassa.NotFoundException):
                 meta = {'status': states.PENDING, 'result': None}
             return meta

+ 2 - 2
celery/backends/mongodb.py

@@ -174,14 +174,14 @@ class MongoBackend(BaseBackend):
         """Get task metadata for a task by id."""
         obj = self.collection.find_one({'_id': task_id})
         if obj:
-            return {
+            return self.meta_from_decoded({
                 'task_id': obj['_id'],
                 'status': obj['status'],
                 'result': self.decode(obj['result']),
                 'date_done': obj['date_done'],
                 'traceback': self.decode(obj['traceback']),
                 'children': self.decode(obj['children']),
-            }
+            })
         return {'status': states.PENDING, 'result': None}
 
     def _save_group(self, group_id, result):

+ 1 - 0
funtests/stress/stress/templates.py

@@ -50,6 +50,7 @@ def template_names():
 
 @template()
 class default(object):
+    BROKER_HEARTBEAT=2
     CELERY_ACCEPT_CONTENT = ['json']
     CELERY_DEFAULT_QUEUE = CSTRESS_QUEUE
     CELERY_TASK_SERIALIZER = 'json'