mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd:Ⓜ️:homeserver: Use central imports map; reorder constructions.
This commit is contained in:
parent
275f350649
commit
ec5fd98f59
2 changed files with 14 additions and 10 deletions
|
@ -67,8 +67,8 @@ struct ircd::m::homeserver
|
|||
/// Configuration
|
||||
std::unique_ptr<struct conf> conf;
|
||||
|
||||
/// Loaded modules.
|
||||
std::list<ircd::module> modules;
|
||||
/// Requested modules.
|
||||
std::vector<string_view> modules;
|
||||
|
||||
/// vm
|
||||
std::shared_ptr<vm::init> vm;
|
||||
|
|
|
@ -249,11 +249,13 @@ ircd::m::homeserver::homeserver(const struct opts *const &opts)
|
|||
{
|
||||
begin(matrix::module_names), end(matrix::module_names)
|
||||
}
|
||||
,vm
|
||||
{
|
||||
std::make_shared<vm::init>()
|
||||
}
|
||||
{
|
||||
for(const auto &name : modules)
|
||||
mods::imports.emplace(std::string{name}, name);
|
||||
|
||||
if(primary == this)
|
||||
vm = std::make_shared<vm::init>();
|
||||
|
||||
if(primary == this && conf)
|
||||
conf->load();
|
||||
|
||||
|
@ -287,17 +289,19 @@ noexcept
|
|||
m::sync::pool.join();
|
||||
}
|
||||
|
||||
|
||||
signoff(*this);
|
||||
if(primary == this)
|
||||
mods::imports.erase("net_dns_cache"s);
|
||||
|
||||
vm.reset();
|
||||
if(primary == this)
|
||||
vm.reset();
|
||||
|
||||
if(primary == this)
|
||||
_fetch.reset(nullptr);
|
||||
|
||||
while(!modules.empty())
|
||||
modules.pop_back();
|
||||
if(primary == this)
|
||||
for(auto rit(rbegin(modules)); rit != rend(modules); ++rit)
|
||||
mods::imports.erase(*rit);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue