0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +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>()
}
{
if(primary == this && dbs::events && sequence(*dbs::events) == 0)
bootstrap(*this);
if(primary == this && conf)
conf->load();
if(primary == this && dbs::events && sequence(*dbs::events) == 0)
bootstrap(*this);
if(key && !key->verify_keys.empty())
m::keys::cache::set(key->verify_keys);
signon(*this);
if(primary == this)
mods::imports.emplace("net_dns"s, "net_dns"s);
if(primary == this)
m::init::backfill::init();
}

View file

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

View file

@ -2097,9 +2097,10 @@ console_cmd__mod__reload(opt &out, const string_view &line)
{
const auto &name{*it};
if(mods::imports.erase(std::string{name}))
{
out << name << " unloaded." << std::endl;
else
out << name << " is not loaded." << std::endl;
break;
}
}
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
//
namespace ircd::net::dns {
namespace [[gnu::visibility("hidden")]] cache
namespace ircd::net::dns::cache
{
static void create_room();
extern m::hookfn<m::vm::eval &> create_room_hook;
}}
}
decltype(ircd::net::dns::cache::create_room_hook)
ircd::net::dns::cache::create_room_hook
{
{
{ "_site", "vm.effect" },
{ "room_id", "!ircd" },
{ "type", "m.room.create" },
{ "_site", "vm.effect" },
{ "room_id", "!ircd" },
{ "type", "m.room.create" },
},
[](const m::event &, m::vm::eval &)
{