summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAyanda Dube <ayanda.dube@erlang-solutions.com>2015-09-25 11:24:03 +0100
committerAyanda Dube <ayanda.dube@erlang-solutions.com>2015-10-07 08:46:41 +0100
commit4a10191e3651eab8ba310dd8234fd293a79e03e8 (patch)
tree8d304d356d73644cd938f68a8498074854de64e7 /src
parentaaf06adf5509dd4b10367fb6c782548ecf7101d6 (diff)
downloadrabbitmq-server-git-4a10191e3651eab8ba310dd8234fd293a79e03e8.tar.gz
Moves mapping and response message sending to list_formatted/3.
References #62
Diffstat (limited to 'src')
-rw-r--r--src/rabbit_policy.erl7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/rabbit_policy.erl b/src/rabbit_policy.erl
index 198cc9d7e7..51a1d65390 100644
--- a/src/rabbit_policy.erl
+++ b/src/rabbit_policy.erl
@@ -171,17 +171,14 @@ list_formatted(VHost) ->
order_policies(list0(VHost, fun format/1)).
list_formatted(VHost, Ref, AggregatorPid) ->
- list0(VHost, fun format/1, Ref, AggregatorPid),
+ [AggregatorPid ! {Ref, p(P, fun format/1)} ||
+ P <- rabbit_runtime_parameters:list(VHost, <<"policy">>)],
AggregatorPid ! {Ref, finished},
ok.
list0(VHost, DefnFun) ->
[p(P, DefnFun) || P <- rabbit_runtime_parameters:list(VHost, <<"policy">>)].
-list0(VHost, DefnFun, Ref, AggregatorPid) ->
- [AggregatorPid ! {Ref, p(P, DefnFun)} ||
- P <- rabbit_runtime_parameters:list(VHost, <<"policy">>)].
-
order_policies(PropList) ->
lists:sort(fun (A, B) -> pget(priority, A) < pget(priority, B) end,
PropList).