summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Watson <tim@rabbitmq.com>2014-02-21 10:45:11 +0000
committerTim Watson <tim@rabbitmq.com>2014-02-21 10:45:11 +0000
commit17d987ebfa1f859bd0412ade9c589e2397e97247 (patch)
treeccc04102c1f135a98b028df09d731bfa03d31d88
parent04df9801211ae8defb19a296c4154d7e4594304d (diff)
downloadrabbitmq-server-17d987ebfa1f859bd0412ade9c589e2397e97247.tar.gz
Cosmetic - reduce the distance to default a bit more
-rw-r--r--src/app_utils.erl6
-rw-r--r--src/rabbit.erl57
2 files changed, 30 insertions, 33 deletions
diff --git a/src/app_utils.erl b/src/app_utils.erl
index 5eeb6924..e53909dd 100644
--- a/src/app_utils.erl
+++ b/src/app_utils.erl
@@ -69,6 +69,7 @@ stop_applications(Apps, ErrorHandler) ->
ErrorHandler,
Apps).
+
wait_for_applications(Apps) ->
[wait_for_application(App) || App <- Apps], ok.
@@ -80,9 +81,8 @@ app_dependency_order(RootApps, StripUnreachable) ->
{App, _Desc, _Vsn} <- application:loaded_applications()]),
try
case StripUnreachable of
- true -> digraph:del_vertices(
- G, digraph:vertices(G) --
- digraph_utils:reachable(RootApps, G));
+ true -> digraph:del_vertices(G, digraph:vertices(G) --
+ digraph_utils:reachable(RootApps, G));
false -> ok
end,
digraph_utils:topsort(G)
diff --git a/src/rabbit.erl b/src/rabbit.erl
index e7aaee51..adfb934e 100644
--- a/src/rabbit.erl
+++ b/src/rabbit.erl
@@ -305,42 +305,40 @@ ensure_application_loaded() ->
end.
start() ->
- boot_with(
- fun() ->
- %% We do not want to HiPE compile or upgrade
- %% mnesia after just restarting the app
- ok = ensure_application_loaded(),
- ok = ensure_working_log_handlers(),
- rabbit_node_monitor:prepare_cluster_status_files(),
- rabbit_mnesia:check_cluster_consistency(),
- ok = rabbit_boot:start(app_startup_order()),
- ok = log_broker_started(rabbit_plugins:active())
- end).
+ boot_with(fun() ->
+ %% We do not want to HiPE compile or upgrade
+ %% mnesia after just restarting the app
+ ok = ensure_application_loaded(),
+ ok = ensure_working_log_handlers(),
+ rabbit_node_monitor:prepare_cluster_status_files(),
+ rabbit_mnesia:check_cluster_consistency(),
+ ok = rabbit_boot:start(app_startup_order()),
+ ok = log_broker_started(rabbit_plugins:active())
+ end).
boot() ->
- boot_with(
- fun() ->
- ok = ensure_application_loaded(),
- Success = maybe_hipe_compile(),
- ok = ensure_working_log_handlers(),
- warn_if_hipe_compilation_failed(Success),
- rabbit_node_monitor:prepare_cluster_status_files(),
- ok = rabbit_upgrade:maybe_upgrade_mnesia(),
- %% It's important that the consistency check happens after
- %% the upgrade, since if we are a secondary node the
- %% primary node will have forgotten us
- rabbit_mnesia:check_cluster_consistency(),
- Plugins = rabbit_plugins:setup(),
- ToBeLoaded = Plugins ++ ?APPS,
- ok = rabbit_boot:start(ToBeLoaded),
- ok = log_broker_started(Plugins)
- end).
+ boot_with(fun() ->
+ ok = ensure_application_loaded(),
+ Success = maybe_hipe_compile(),
+ ok = ensure_working_log_handlers(),
+ warn_if_hipe_compilation_failed(Success),
+ rabbit_node_monitor:prepare_cluster_status_files(),
+ ok = rabbit_upgrade:maybe_upgrade_mnesia(),
+ %% It's important that the consistency check happens after
+ %% the upgrade, since if we are a secondary node the
+ %% primary node will have forgotten us
+ rabbit_mnesia:check_cluster_consistency(),
+ Plugins = rabbit_plugins:setup(),
+ ToBeLoaded = Plugins ++ ?APPS,
+ ok = rabbit_boot:start(ToBeLoaded),
+ ok = log_broker_started(Plugins)
+ end).
boot_with(StartFun) ->
Marker = spawn_link(fun() -> receive stop -> ok end end),
case catch register(rabbit_boot, Marker) of
true -> try
- case rabbit:is_running() of
+ case is_running() of
true -> ok;
false -> StartFun()
end
@@ -455,7 +453,6 @@ stop(_State) ->
true -> rabbit_amqqueue:on_node_down(node());
false -> rabbit_table:clear_ram_only_tables()
end,
- ok = rabbit_boot:shutdown(),
ok.
%%---------------------------------------------------------------------------