diff --git a/Cargo.toml b/Cargo.toml index 705cd6c..5f6a745 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ serde-inline-default = "0.1" # TODO this hopefully won't be needed anymore soon async-trait = "0.1" html-escape = "0.2" clap = { version = "4.4", features = ["derive", "cargo"] } -tokio = { version = "1.35", features = ["macros", "rt-multi-thread"] } +tokio = { version = "1.35" } axum = "0.7" # db providers sqlx = { version = "0.7", features = ["runtime-tokio", "tls-rustls", "any"] } diff --git a/src/main.rs b/src/main.rs index 21060d3..add7ced 100644 --- a/src/main.rs +++ b/src/main.rs @@ -58,8 +58,7 @@ enum CliAction { }, } -#[tokio::main] -async fn main() { +async fn launch() { let args = CliArgs::parse(); tracing_subscriber::fmt::fmt() @@ -160,6 +159,14 @@ async fn main() { } } +fn main() { + tokio::runtime::Builder::new_current_thread() + .build().expect("could not create tokio runtime") + .block_on(async { + launch().await + }); +} + // it drives me nuts that it doesn't do it by default!!! is there an option? fn if_using_sqlite_driver_and_file_is_missing_create_it_beforehand(uri: &str) { use std::str::FromStr; @@ -172,5 +179,4 @@ fn if_using_sqlite_driver_and_file_is_missing_create_it_beforehand(uri: &str) { } } } - }