From 5f3966c62e6d08984b1716fd2c8ae8145ff1ff09 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu+github@posteo.de> Date: Tue, 28 Sep 2021 21:28:10 +0200 Subject: [PATCH] Fix tokio assertion --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index c77bdc7..376f31c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,10 +16,12 @@ use telegram_notes_bot::*; #[tokio::main] async fn main() -> Result<(), Error> { - env_logger::init(); - Lazy::force(&OWNER); - Lazy::force(&API); - Lazy::force(&TRILIUM_TOKEN); + task::spawn_blocking(|| { + env_logger::init(); + Lazy::force(&OWNER); + Lazy::force(&API); + Lazy::force(&TRILIUM_TOKEN); + }).await.unwrap(); println!("Init done!"); task::spawn(task_alerts());