diff options
author | Joan Touzet <wohali@users.noreply.github.com> | 2020-02-19 19:03:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-19 19:03:32 +0000 |
commit | b3353a27767b81ae2a1b29b5a3cf07f38270ef57 (patch) | |
tree | 81f73b7eecde54055fd775bdb3d3aff904675904 | |
parent | 6437968b3eaab095595760e2798109ca4a0a2aed (diff) | |
download | couchdb-b3353a27767b81ae2a1b29b5a3cf07f38270ef57.tar.gz |
fix: single node state (#2574) (#2578)
Co-authored-by: Jan Lehnardt <jan@apache.org>
-rw-r--r-- | src/setup/src/setup.erl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/setup/src/setup.erl b/src/setup/src/setup.erl index 3d23229b8..cc64ae438 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() -> |