summaryrefslogtreecommitdiff
path: root/src/rabbit_control_main.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2012-12-06 16:52:13 +0000
committerSimon MacMullen <simon@rabbitmq.com>2012-12-06 16:52:13 +0000
commit8f088d8fe0403274b417bf7baad16de317ac23bb (patch)
tree6719bec734b8ba01c1fb4f7a30abbdb124f23e74 /src/rabbit_control_main.erl
parentbd4dad1150be114357b8c5730c9942b43b425c5b (diff)
downloadrabbitmq-server-8f088d8fe0403274b417bf7baad16de317ac23bb.tar.gz
Add rabbitmqctl sync_queue, and make it synchronous. Also fix the fact that we were treating "no queues to sync" as a 'normal' crash of the syncer, which... no.
Diffstat (limited to 'src/rabbit_control_main.erl')
-rw-r--r--src/rabbit_control_main.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl
index 669a0787..b4272555 100644
--- a/src/rabbit_control_main.erl
+++ b/src/rabbit_control_main.erl
@@ -50,6 +50,7 @@
update_cluster_nodes,
{forget_cluster_node, [?OFFLINE_DEF]},
cluster_status,
+ {sync_queue, [?VHOST_DEF]},
add_user,
delete_user,
@@ -280,6 +281,12 @@ action(forget_cluster_node, Node, [ClusterNodeS], Opts, Inform) ->
rpc_call(Node, rabbit_mnesia, forget_cluster_node,
[ClusterNode, RemoveWhenOffline]);
+action(sync_queue, Node, [Queue], Opts, Inform) ->
+ VHost = proplists:get_value(?VHOST_OPT, Opts),
+ Inform("Synchronising queue ~s in ~s", [Queue, VHost]),
+ rpc_call(Node, rabbit_amqqueue, sync,
+ [list_to_binary(Queue), list_to_binary(VHost)]);
+
action(wait, Node, [PidFile], _Opts, Inform) ->
Inform("Waiting for ~p", [Node]),
wait_for_application(Node, PidFile, rabbit_and_plugins, Inform);