summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-01-03 17:15:33 +0000
committerSimon MacMullen <simon@rabbitmq.com>2013-01-03 17:15:33 +0000
commit01cf4d99f0b32c525b07689c137db1dec29aa8e6 (patch)
tree9e3efcd721f5c3bece33f259ac9417d4ad3a5640
parent368f5605e9f3943dcde0f81a85af1b4e45142626 (diff)
downloadrabbitmq-server-git-01cf4d99f0b32c525b07689c137db1dec29aa8e6.tar.gz
Don't use a closure for the usual cluster upgrade reasons.
-rw-r--r--src/rabbit_control_main.erl11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl
index 24528e32d5..70ca6177bf 100644
--- a/src/rabbit_control_main.erl
+++ b/src/rabbit_control_main.erl
@@ -17,7 +17,7 @@
-module(rabbit_control_main).
-include("rabbit.hrl").
--export([start/0, stop/0, action/5]).
+-export([start/0, stop/0, action/5, sync_queue/1]).
-define(RPC_TIMEOUT, infinity).
-define(EXTERNAL_CHECK_INTERVAL, 1000).
@@ -284,9 +284,8 @@ action(forget_cluster_node, Node, [ClusterNodeS], Opts, Inform) ->
action(sync_queue, Node, [Q], Opts, Inform) ->
VHost = proplists:get_value(?VHOST_OPT, Opts),
Inform("Synchronising queue \"~s\" in vhost \"~s\"", [Q, VHost]),
- rpc_call(Node, rabbit_amqqueue, with,
- [rabbit_misc:r(list_to_binary(VHost), queue, list_to_binary(Q)),
- fun(#amqqueue{pid = P}) -> rabbit_amqqueue:sync_mirrors(P) end]);
+ rpc_call(Node, rabbit_control_main, sync_queue,
+ [rabbit_misc:r(list_to_binary(VHost), queue, list_to_binary(Q))]);
action(wait, Node, [PidFile], _Opts, Inform) ->
Inform("Waiting for ~p", [Node]),
@@ -521,6 +520,10 @@ action(eval, Node, [Expr], _Opts, _Inform) ->
format_parse_error({_Line, Mod, Err}) -> lists:flatten(Mod:format_error(Err)).
+sync_queue(Q) ->
+ rabbit_amqqueue:with(
+ Q, fun(#amqqueue{pid = QPid}) -> rabbit_amqqueue:sync_mirrors(QPid) end).
+
%%----------------------------------------------------------------------------
wait_for_application(Node, PidFile, Application, Inform) ->