mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 08:23:56 +01:00
ircd:Ⓜ️ Improve fetch init/fini for now.
This commit is contained in:
parent
0d523f95e3
commit
8259ac6a31
3 changed files with 22 additions and 16 deletions
|
@ -39,6 +39,7 @@
|
|||
///
|
||||
namespace ircd::m::fetch
|
||||
{
|
||||
struct init;
|
||||
struct opts;
|
||||
struct result;
|
||||
struct request;
|
||||
|
@ -184,6 +185,12 @@ struct ircd::m::fetch::request
|
|||
~request() noexcept;
|
||||
};
|
||||
|
||||
/// Internally held
|
||||
struct ircd::m::fetch::init
|
||||
{
|
||||
init(), ~init() noexcept;
|
||||
};
|
||||
|
||||
inline
|
||||
ircd::m::fetch::result::operator
|
||||
json::array()
|
||||
|
|
|
@ -45,9 +45,6 @@ namespace ircd::m::fetch
|
|||
static void request_handle();
|
||||
static size_t request_cleanup();
|
||||
static void request_worker();
|
||||
|
||||
void init();
|
||||
void fini();
|
||||
}
|
||||
|
||||
decltype(ircd::m::fetch::log)
|
||||
|
@ -103,13 +100,12 @@ ircd::m::fetch::dock;
|
|||
// init
|
||||
//
|
||||
|
||||
void
|
||||
ircd::m::fetch::init()
|
||||
ircd::m::fetch::init::init()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ircd::m::fetch::fini()
|
||||
ircd::m::fetch::init::~init()
|
||||
noexcept
|
||||
{
|
||||
request_context.terminate();
|
||||
request_context.join();
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
|
||||
namespace ircd::m
|
||||
{
|
||||
std::unique_ptr<dbs::init> _dbs;
|
||||
std::unique_ptr<init::modules> _modules;
|
||||
|
||||
static void on_load(), on_unload() noexcept;
|
||||
}
|
||||
|
||||
|
@ -49,14 +46,20 @@ me_offline_status_msg
|
|||
{ "default", "Catch ya on the flip side..." }
|
||||
};
|
||||
|
||||
namespace ircd::m::fetch
|
||||
{
|
||||
void init(), fini();
|
||||
}
|
||||
/// --- tmp ---
|
||||
|
||||
extern "C" void
|
||||
reload_conf();
|
||||
|
||||
namespace ircd::m
|
||||
{
|
||||
std::unique_ptr<dbs::init> _dbs;
|
||||
std::unique_ptr<fetch::init> _fetch;
|
||||
std::unique_ptr<init::modules> _modules;
|
||||
}
|
||||
|
||||
/// --- /tmp ---
|
||||
|
||||
void
|
||||
ircd::m::on_load()
|
||||
try
|
||||
|
@ -65,7 +68,7 @@ try
|
|||
m::self::init::keys();
|
||||
_dbs = std::make_unique<dbs::init>(ircd::server_name, std::string{});
|
||||
reload_conf();
|
||||
m::fetch::init();
|
||||
_fetch = std::make_unique<fetch::init>();
|
||||
_modules = std::make_unique<init::modules>();
|
||||
|
||||
if(!ircd::write_avoid && vm::sequence::retired != 0)
|
||||
|
@ -99,7 +102,6 @@ ircd::m::on_unload()
|
|||
noexcept try
|
||||
{
|
||||
mods::imports.erase("m_listen"s);
|
||||
m::fetch::fini();
|
||||
|
||||
if(m::sync::pool.size())
|
||||
m::sync::pool.join();
|
||||
|
@ -107,6 +109,7 @@ noexcept try
|
|||
if(!std::uncaught_exceptions() && !ircd::write_avoid)
|
||||
presence::set(me, "offline", me_offline_status_msg);
|
||||
|
||||
_fetch.reset(nullptr);
|
||||
_modules.reset(nullptr);
|
||||
_dbs.reset(nullptr);
|
||||
|
||||
|
|
Loading…
Reference in a new issue