From 6e5d1c7dd44696617d8624bef9328092619f6780 Mon Sep 17 00:00:00 2001 From: Adam Kocoloski Date: Fri, 2 Jul 2010 11:10:55 -0400 Subject: show distributed tasks in _active_tasks --- src/chttpd_misc.erl | 8 ++++++-- 1 file 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"). -- cgit v1.2.3