From c5d60c1af6cd328bed3b2297662d880fe47bd0c8 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 27 Jul 2020 23:17:03 -0700 Subject: [PATCH] construct: Slave implies read-only. --- construct/construct.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/construct/construct.cc b/construct/construct.cc index 2dd92ed9c..ed5be04b8 100644 --- a/construct/construct.cc +++ b/construct/construct.cc @@ -482,14 +482,19 @@ applyargs() if(defaults) ircd::defaults.set("true"); - if(read_only) - ircd::read_only.set("true"); - if(slave) + { ircd::db::open_slave.set("true"); + read_only = true; // slave implies read_only + } - // read_only implies write_avoid. - if(write_avoid || read_only) + if(read_only) + { + ircd::read_only.set("true"); + write_avoid = true; // read_only implies write_avoid. + } + + if(write_avoid) ircd::write_avoid.set("true"); if(debugmode)