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 | 12ea184cc5b844f92abe48c7135e0a8b4f2aa5d8 (patch) | |
| tree | 5d00c78064ad8f5b86ba65886470515650c20a88 | |
| parent | c6a9501266c39d0efb085e6ae541114531c060dc (diff) | |
| download | rabbitmq-server-git-12ea184cc5b844f92abe48c7135e0a8b4f2aa5d8.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 12573fd25e..05af43e05d 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 |
