enter the tokio runtime for the scope of main init

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-27 02:55:38 +00:00
parent f69c596f56
commit 4f97ff98d6

View file

@ -24,6 +24,8 @@ pub(crate) struct Server {
impl Server { impl Server {
pub(crate) fn build(args: &Args, runtime: Option<&runtime::Handle>) -> Result<Arc<Self>, Error> { pub(crate) fn build(args: &Args, runtime: Option<&runtime::Handle>) -> Result<Arc<Self>, Error> {
let _runtime_guard = runtime.map(runtime::Handle::enter);
let raw_config = Config::load(args.config.as_deref())?; let raw_config = Config::load(args.config.as_deref())?;
let raw_config = crate::clap::update(raw_config, args)?; let raw_config = crate::clap::update(raw_config, args)?;
let config = Config::new(&raw_config)?; let config = Config::new(&raw_config)?;