diff options
author | Matthias Radestock <matthias@rabbitmq.com> | 2012-09-24 13:59:48 +0100 |
---|---|---|
committer | Matthias Radestock <matthias@rabbitmq.com> | 2012-09-24 13:59:48 +0100 |
commit | 5dc2bc925925de789b1b287d3184eb8680c0f8b4 (patch) | |
tree | 5d00c78064ad8f5b86ba65886470515650c20a88 | |
parent | b9500aca846d06524c6d383414cad408c178a424 (diff) | |
download | rabbitmq-server-5dc2bc925925de789b1b287d3184eb8680c0f8b4.tar.gz |
inline init/2
-rw-r--r-- | src/rabbit_mnesia.erl | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rabbit_mnesia.erl b/src/rabbit_mnesia.erl index 12573fd2..05af43e0 100644 --- a/src/rabbit_mnesia.erl +++ b/src/rabbit_mnesia.erl @@ -111,7 +111,9 @@ init() -> ensure_mnesia_dir(), case is_virgin_node() of true -> init_from_config(); - false -> init(node_type(), cluster_nodes(all)) + false -> NodeType = node_type(), + init_db_and_upgrade(cluster_nodes(all), NodeType, + NodeType =:= ram) end, %% We intuitively expect the global name server to be synced when %% Mnesia is up. In fact that's not guaranteed to be the case - @@ -119,9 +121,6 @@ init() -> ok = global:sync(), ok. -init(NodeType, AllNodes) -> - init_db_and_upgrade(AllNodes, NodeType, NodeType =:= ram). - init_from_config() -> {ok, {TryNodes, NodeType}} = application:get_env(rabbit, cluster_nodes), @@ -136,7 +135,7 @@ init_from_config() -> rabbit_log:warning("Could not find any suitable node amongst the " "ones provided in the configuration: ~p~n", [TryNodes]), - init(disc, [node()]) + init_db_and_upgrade([node()], disc, false) end. %% Make the node join a cluster. The node will be reset automatically |