From daa3cd6284b44b4e27e0004af7a8e862d42236ea Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 27 Jul 2020 22:16:04 -0700 Subject: [PATCH] ircd::m::homeserver: Fix missing conditions for write-avoid functionality. --- matrix/homeserver.cc | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/matrix/homeserver.cc b/matrix/homeserver.cc index 68a0a46a7..de4f8620f 100644 --- a/matrix/homeserver.cc +++ b/matrix/homeserver.cc @@ -260,7 +260,7 @@ try _vm.reset(nullptr); }}; - if(dbs::events && sequence(*dbs::events) == 0) + if(!ircd::write_avoid && dbs::events && sequence(*dbs::events) == 0) { if(opts->bootstrap_vector_path) bootstrap_event_vector(*this); @@ -268,12 +268,16 @@ try bootstrap(*this); } - if(key && !key->verify_keys.empty()) - m::keys::cache::set(key->verify_keys); - - signon(*this); mods::imports.emplace("net_dns_cache"s, "net_dns_cache"s); - m::init::backfill::init(); + + if(!ircd::write_avoid) + { + if(key && !key->verify_keys.empty()) + m::keys::cache::set(key->verify_keys); + + signon(*this); + m::init::backfill::init(); + } } catch(const std::exception &e) { @@ -300,7 +304,7 @@ noexcept try server::init::wait(); m::sync::pool.join(); - if(_vm) + if(!ircd::write_avoid && _vm) signoff(*this); ///TODO: XXX primary