diff options
author | Matthew Sackman <matthew@rabbitmq.com> | 2011-02-08 13:17:00 +0000 |
---|---|---|
committer | Matthew Sackman <matthew@rabbitmq.com> | 2011-02-08 13:17:00 +0000 |
commit | fbc8e8a3be7671c02d73b7af0f9342fcf2757b5e (patch) | |
tree | 2c189c0a8633e105e9c7f9e1e8ca60a5b5af0292 | |
parent | 592c42e10b0d2c1d90347eb3540eeda44382240a (diff) | |
download | rabbitmq-server-bug23813.tar.gz |
Move the booting of the delegate to rabbitbug23813
-rw-r--r-- | src/delegate_sup.erl | 7 | ||||
-rw-r--r-- | src/rabbit.erl | 11 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/delegate_sup.erl b/src/delegate_sup.erl index 78e8eadc..fc693c7d 100644 --- a/src/delegate_sup.erl +++ b/src/delegate_sup.erl @@ -19,7 +19,6 @@ -behaviour(supervisor). -export([start_link/1, count/1]). --export([boot/0]). -export([init/1]). @@ -32,8 +31,6 @@ -spec(start_link/1 :: (integer()) -> {'ok', pid()} | {'error', any()}). -spec(count/1 :: ([node()]) -> integer()). --spec(boot/0 :: () -> 'ok'). - -endif. %%---------------------------------------------------------------------------- @@ -53,10 +50,6 @@ count([Node | Nodes]) -> count(Nodes) end. -boot() -> - {ok, Count} = application:get_env(rabbit, delegate_count), - rabbit_sup:start_child(delegate_sup, [Count]). - %%---------------------------------------------------------------------------- init([Count]) -> diff --git a/src/rabbit.erl b/src/rabbit.erl index 101c97f7..81e0e54b 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -27,7 +27,7 @@ %%--------------------------------------------------------------------------- %% Boot steps. --export([maybe_insert_default_data/0]). +-export([maybe_insert_default_data/0, boot_delegate/0]). -rabbit_boot_step({codec_correctness_check, [{description, "codec correctness check"}, @@ -101,7 +101,7 @@ -rabbit_boot_step({delegate_sup, [{description, "cluster delegate"}, - {mfa, {delegate_sup, boot, []}}, + {mfa, {rabbit, boot_delegate, []}}, {requires, kernel_ready}, {enables, core_initialized}]}). @@ -178,6 +178,9 @@ {running_nodes, [node()]}]). -spec(log_location/1 :: ('sasl' | 'kernel') -> log_location()). +-spec(maybe_insert_default_data/0 :: () -> 'ok'). +-spec(boot_delegate/0 :: () -> 'ok'). + -endif. %%---------------------------------------------------------------------------- @@ -447,6 +450,10 @@ ensure_working_log_handler(OldFHandler, NewFHandler, TTYHandler, end end. +boot_delegate() -> + {ok, Count} = application:get_env(rabbit, delegate_count), + rabbit_sup:start_child(delegate_sup, [Count]). + maybe_insert_default_data() -> case rabbit_mnesia:is_db_empty() of true -> insert_default_data(); |