From 6d65c3f4620cc447ff9d40ceb75d3aeb878d2984 Mon Sep 17 00:00:00 2001 From: phil Date: Thu, 3 Jul 2025 12:11:30 -0400 Subject: [PATCH] single-thread tokio not actually sure if this is needed for the raspi but initially i thought metrics weren't working. (they are fine) --- who-am-i/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/who-am-i/src/main.rs b/who-am-i/src/main.rs index e4f5ed1..75d3bcf 100644 --- a/who-am-i/src/main.rs +++ b/who-am-i/src/main.rs @@ -1,5 +1,5 @@ use clap::{ArgAction, Parser}; -use metrics_exporter_prometheus::PrometheusBuilder; +use metrics_exporter_prometheus::{PrometheusBuilder, BuildError as PromBuildError}; use tokio_util::sync::CancellationToken; use who_am_i::serve; @@ -26,7 +26,7 @@ struct Args { allowed_hosts: Vec, } -#[tokio::main] +#[tokio::main(flavor = "current_thread")] async fn main() { let shutdown = CancellationToken::new(); @@ -51,7 +51,7 @@ async fn main() { serve(shutdown, args.app_secret, args.allowed_hosts, args.dev).await; } -fn install_metrics_server() -> Result<(), metrics_exporter_prometheus::BuildError> { +fn install_metrics_server() -> Result<(), PromBuildError> { println!("installing metrics server..."); let host = [0, 0, 0, 0]; let port = 8765; -- 2.51.2