You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2020/02/19 15:59:32 UTC
[couchdb] 01/01: fix: single node state
This is an automated email from the ASF dual-hosted git repository.
jan pushed a commit to branch fix/2557/single-node-state
in repository https://gitbox.apache.org/repos/asf/couchdb.git
commit 5e5d029f556332eb118836a0651984bf7af1f044
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Wed Feb 19 16:59:11 2020 +0100
fix: single node state
---
src/setup/src/setup.erl | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/setup/src/setup.erl b/src/setup/src/setup.erl
index 3d23229..cc64ae4 100644
--- a/src/setup/src/setup.erl
+++ b/src/setup/src/setup.erl
@@ -65,13 +65,15 @@ is_cluster_enabled() ->
end.
is_single_node_enabled(Dbs) ->
- % admins != empty AND dbs exist
+ % admins != empty AND dbs exist OR `[couchdb] single_node` is set to true
Admins = config:get("admins"),
HasDbs = has_cluster_system_dbs(Dbs),
- case {Admins, HasDbs} of
- {[], _} -> false;
- {_, false} -> false;
- {_,_} -> true
+ SingleNodeConfig = config:get_boolean("couchdb", "single_node", false),
+ case {Admins, HasDbs, SingleNodeConfig} of
+ {_, _, true} -> true;
+ {[], _, _} -> false;
+ {_, false, _} -> false;
+ {_,_,_} -> true
end.
cluster_system_dbs() ->