0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 07:20:55 +01:00

ircd:Ⓜ️:homeserver: Fix remaining module init for now.

This commit is contained in:
Jason Volk 2019-10-04 15:06:49 -07:00
parent 7ec7390211
commit f8e74fbc36
4 changed files with 17 additions and 23 deletions

View file

@ -225,17 +225,20 @@ ircd::m::homeserver::homeserver(const struct opts *const &opts)
std::make_shared<vm::init>() std::make_shared<vm::init>()
} }
{ {
if(primary == this && dbs::events && sequence(*dbs::events) == 0)
bootstrap(*this);
if(primary == this && conf) if(primary == this && conf)
conf->load(); conf->load();
if(primary == this && dbs::events && sequence(*dbs::events) == 0)
bootstrap(*this);
if(key && !key->verify_keys.empty()) if(key && !key->verify_keys.empty())
m::keys::cache::set(key->verify_keys); m::keys::cache::set(key->verify_keys);
signon(*this); signon(*this);
if(primary == this)
mods::imports.emplace("net_dns"s, "net_dns"s);
if(primary == this) if(primary == this)
m::init::backfill::init(); m::init::backfill::init();
} }

View file

@ -35,8 +35,6 @@ IRCD_MODULE_EXPORT_DATA
decltype(ircd::m::matrix::module_names) decltype(ircd::m::matrix::module_names)
ircd::m::matrix::module_names ircd::m::matrix::module_names
{ {
"net_dns",
"media_media", "media_media",
"well_known", "well_known",
@ -171,9 +169,6 @@ ircd::m::matrix::module_names_optional
/// --- tmp --- /// --- tmp ---
extern "C" void
reload_conf();
namespace ircd::m::init namespace ircd::m::init
{ {
struct modules; struct modules;
@ -181,7 +176,6 @@ namespace ircd::m::init
namespace ircd::m namespace ircd::m
{ {
std::unique_ptr<dbs::init> _dbs;
std::unique_ptr<fetch::init> _fetch; std::unique_ptr<fetch::init> _fetch;
//std::unique_ptr<init::modules> _modules; //std::unique_ptr<init::modules> _modules;
} }
@ -193,10 +187,7 @@ ircd::m::on_load()
try try
{ {
assert(ircd::run::level == run::level::IDLE); assert(ircd::run::level == run::level::IDLE);
//reload_conf();
_fetch = std::make_unique<fetch::init>(); _fetch = std::make_unique<fetch::init>();
//_modules = std::make_unique<init::modules>();
//self::signon();
} }
catch(const m::error &e) catch(const m::error &e)
{ {
@ -225,13 +216,12 @@ void
ircd::m::on_unload() ircd::m::on_unload()
noexcept try noexcept try
{ {
//mods::imports.erase("m_listen"s);
if(m::sync::pool.size()) if(m::sync::pool.size())
m::sync::pool.join(); m::sync::pool.join();
//self::signoff();
_fetch.reset(nullptr); _fetch.reset(nullptr);
//_modules.reset(nullptr);
mods::imports.erase("net_dns"s);
//TODO: remove this for non-interfering shutdown //TODO: remove this for non-interfering shutdown
//server::interrupt_all(); //server::interrupt_all();

View file

@ -2097,9 +2097,10 @@ console_cmd__mod__reload(opt &out, const string_view &line)
{ {
const auto &name{*it}; const auto &name{*it};
if(mods::imports.erase(std::string{name})) if(mods::imports.erase(std::string{name}))
{
out << name << " unloaded." << std::endl; out << name << " unloaded." << std::endl;
else break;
out << name << " is not loaded." << std::endl; }
} }
for(auto it(names.rbegin()); it != names.rend(); ++it) for(auto it(names.rbegin()); it != names.rend(); ++it)

View file

@ -676,20 +676,20 @@ ircd::net::dns::cache::waiter::waiter(const hostport &hp,
// cache room creation // cache room creation
// //
namespace ircd::net::dns { namespace ircd::net::dns::cache
namespace [[gnu::visibility("hidden")]] cache
{ {
static void create_room(); static void create_room();
extern m::hookfn<m::vm::eval &> create_room_hook; extern m::hookfn<m::vm::eval &> create_room_hook;
}} }
decltype(ircd::net::dns::cache::create_room_hook) decltype(ircd::net::dns::cache::create_room_hook)
ircd::net::dns::cache::create_room_hook ircd::net::dns::cache::create_room_hook
{ {
{ {
{ "_site", "vm.effect" }, { "_site", "vm.effect" },
{ "room_id", "!ircd" }, { "room_id", "!ircd" },
{ "type", "m.room.create" }, { "type", "m.room.create" },
}, },
[](const m::event &, m::vm::eval &) [](const m::event &, m::vm::eval &)
{ {