0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-17 15:30:52 +01:00

modules/s_conf: Eliminate the redundant conf reload after runlevel RUN transition.

This commit is contained in:
Jason Volk 2018-09-29 19:57:14 -07:00
parent 0813adca32
commit ede0f79c3d
2 changed files with 14 additions and 10 deletions

View file

@ -19,6 +19,11 @@ IRCD_MODULE
static const std::string dbopts;
media = std::make_shared<database>("media", dbopts, media_description);
blocks = db::column{*media, "blocks"};
// The conf setter callbacks must be manually executed after
// the database was just loaded to set the cache size.
conf::reset("ircd.media.blocks.cache.size");
conf::reset("ircd.media.blocks.cache_comp.size");
},
[] // fini
{
@ -95,12 +100,6 @@ media_description
media_blocks_descriptor,
};
decltype(media)
media;
decltype(blocks)
blocks;
decltype(media_blocks_cache_size)
media_blocks_cache_size
{
@ -133,6 +132,12 @@ media_blocks_cache_comp_size
}
};
decltype(media)
media;
decltype(blocks)
blocks;
std::set<m::room::id>
downloading;

View file

@ -52,7 +52,6 @@ on_run()
const unwind uw{[] { item_error_log = true; }};
item_error_log = false;
rehash_conf(false);
reload_conf();
}
/// Waits for the daemon to transition to the RUN state so we can gather all
@ -129,14 +128,14 @@ noexcept try
unquote(content.at("value"))
};
if(runlevel == runlevel::START && !conf::exists(key))
return;
log::debug
{
"Updating conf [%s] => %s", key, value
};
if(runlevel == runlevel::START && !conf::exists(key))
return;
ircd::conf::set(key, value);
}
catch(const std::exception &e)