You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by wo...@apache.org on 2020/02/19 18:34:57 UTC

[couchdb] branch 3.x-single-node-state created (now bc611ea)

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

wohali pushed a change to branch 3.x-single-node-state
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


      at bc611ea  fix: single node state (#2574)

This branch includes the following new commits:

     new bc611ea  fix: single node state (#2574)

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 (#2574)

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

wohali pushed a commit to branch 3.x-single-node-state
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit bc611eaee15437ed41bca977ce81c325027a6ef5
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Wed Feb 19 18:39:32 2020 +0100

    fix: single node state (#2574)
---
 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() ->