Skip to content

Commit cc103c1

Browse files
committed
refactor: Change tokio builder logic
1 parent fef9672 commit cc103c1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

crates/konfigkoll/src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ mod _musl {
4848
static GLOBAL: MiMalloc = MiMalloc;
4949
}
5050

51-
#[tokio::main(flavor = "current_thread")]
52-
async fn main() -> eyre::Result<()> {
51+
fn main() -> eyre::Result<()> {
5352
color_eyre::install()?;
5453
// Set up logging with tracing
5554
let filter = tracing_subscriber::EnvFilter::builder()
@@ -63,6 +62,13 @@ async fn main() -> eyre::Result<()> {
6362

6463
let cli = Cli::parse();
6564

65+
let mut builder = tokio::runtime::Builder::new_current_thread();
66+
let rt = builder.enable_all().build()?;
67+
68+
rt.block_on(async { run_main(cli).await })
69+
}
70+
71+
async fn run_main(cli: Cli) -> Result<(), eyre::Error> {
6672
let config_path = match cli.config_path {
6773
Some(v) => v,
6874
None => std::env::current_dir()?.try_into()?,

0 commit comments

Comments
 (0)