summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-07-02 11:10:55 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-12 11:18:47 -0400
commit6e5d1c7dd44696617d8624bef9328092619f6780 (patch)
tree276e146469aaa6f802340fc6f33d85d07d0eb661
parent04974d382c5b530bacfead74de18770f346352ab (diff)
show distributed tasks in _active_tasks
-rw-r--r--src/chttpd_misc.erl8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/chttpd_misc.erl b/src/chttpd_misc.erl
index 535932ae..0aa666f6 100644
--- a/src/chttpd_misc.erl
+++ b/src/chttpd_misc.erl
@@ -98,8 +98,12 @@ handle_all_dbs_req(Req) ->
handle_task_status_req(#httpd{method='GET'}=Req) ->
- % convert the list of prop lists to a list of json objects
- send_json(Req, [{Props} || Props <- couch_task_status:all()]);
+ {Replies, _BadNodes} = gen_server:multi_call(couch_task_status, all),
+ Response = lists:flatmap(fun({Node, Tasks}) ->
+ [{[{node,Node} | Task]} || Task <- Tasks]
+ end, Replies),
+ % TODO filter by customer
+ send_json(Req, Response);
handle_task_status_req(Req) ->
send_method_not_allowed(Req, "GET,HEAD").