diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-27 21:34:44 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-27 21:34:44 +0100 |
commit | 290448e2ecf3ed2003bd149478cad90cb94fc6a0 (patch) | |
tree | c1577a1c42474a010da39d1e1050c5cb320767f4 | |
parent | b0361d395c24eea0bc889f5510c378bddd282169 (diff) | |
download | meta-adservices-290448e2ecf3ed2003bd149478cad90cb94fc6a0.tar meta-adservices-290448e2ecf3ed2003bd149478cad90cb94fc6a0.tar.bz2 meta-adservices-290448e2ecf3ed2003bd149478cad90cb94fc6a0.tar.zst |
fix no reactor running bug
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index c9b80ab..02ee9d9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -21,7 +21,7 @@ use rocket::{ Request, Response, }; use state::{AdInfo, Config, Logic}; -use std::{env::args, fs::read_to_string, io::Cursor, net::IpAddr, sync::Arc}; +use std::{env::args, fs::read_to_string, io::Cursor, net::IpAddr}; use tool::tool_main; fn main() -> anyhow::Result<()> { @@ -64,16 +64,16 @@ fn main() -> anyhow::Result<()> { } } - let state = Logic::new(config); - tokio::runtime::Builder::new_multi_thread() .enable_all() .build()? - .block_on(inner_main(state)); + .block_on(inner_main(config)); Ok(()) } -async fn inner_main(state: Arc<Logic>) { + +async fn inner_main(config: Config) { + let state = Logic::new(config); let _ = rocket::build() .configure(rocket::Config { port: state.config.port, |