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 16:10:54 UTC

[couchdb] branch fix/2557-master/single-node-state created (now 9ed8c2e)

This is an automated email from the ASF dual-hosted git repository.

jan pushed a change to branch fix/2557-master/single-node-state
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at 9ed8c2e  fix: single node state

This branch includes the following new commits:

     new 9ed8c2e  fix: single node state

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[couchdb] 01/01: fix: single node state

Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch fix/2557-master/single-node-state
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 9ed8c2e7849712bb520f4fb4c9163bd347697710
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() ->