Permalink
Browse files

amqp/cassandra/mongodb backends now set result.children

  • Loading branch information...
1 parent 8fd82db commit 6d64d7a24f15311a0bd13baf7f6a9879176d2d08 @ask committed May 9, 2012
Showing with 9 additions and 4 deletions.
  1. +2 −1 celery/backends/amqp.py
  2. +3 −1 celery/backends/cassandra.py
  3. +3 −1 celery/backends/mongodb.py
  4. +1 −1 celery/bin/celeryd.py
View
@@ -118,7 +118,8 @@ def errback(error, delay):
interval_max=interval_max)
send(conn, task_id, {"task_id": task_id, "status": status,
"result": self.encode_result(result, status),
- "traceback": traceback})
+ "traceback": traceback,
+ "children": self.current_task_children()})
return result
def get_task_meta(self, task_id, cache=True):
@@ -131,7 +131,8 @@ def _do_store():
date_done = self.app.now()
meta = {"status": status,
"date_done": date_done.strftime('%Y-%m-%dT%H:%M:%SZ'),
- "traceback": self.encode(traceback)}
+ "traceback": self.encode(traceback),
+ "children": self.encode(self.current_task_children())}
if self.detailed_mode:
meta["result"] = result
cf.insert(task_id, {date_done: self.encode(meta)},
@@ -161,6 +162,7 @@ def _do_get():
"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}
@@ -107,7 +107,8 @@ def _store_result(self, task_id, result, status, traceback=None):
"status": status,
"result": Binary(self.encode(result)),
"date_done": datetime.utcnow(),
- "traceback": Binary(self.encode(traceback))}
+ "traceback": Binary(self.encode(traceback)),
+ "children": Binary(self.encode(self.current_task_children()))}
self.collection.save(meta, safe=True)
return result
@@ -125,6 +126,7 @@ def _get_task_meta_for(self, task_id):
"result": self.decode(obj["result"]),
"date_done": obj["date_done"],
"traceback": self.decode(obj["traceback"]),
+ "children": self.decode(obj["children"]),
}
return meta
View
@@ -12,7 +12,7 @@
Number of child processes processing the queue. The default
is the number of CPUs available on your system.
-.. cmdoption:: -c, --pool
+.. cmdoption:: -P, --pool
Pool implementation:

0 comments on commit 6d64d7a

Please sign in to comment.