From c94e1ea4b0476134a118f44b5b4c75a107338eb2 Mon Sep 17 00:00:00 2001 From: John Rogers Date: Mon, 21 Jul 2025 16:49:35 +0100 Subject: [PATCH] fix: use spawn_local to run non-Send API server task Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2014fab..6b79cad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,6 +18,7 @@ use std::{ sync::{Arc, Mutex, mpsc}, thread, }; +use tokio::task; /// Embed the default config.json at compile time. const DEFAULT_CONFIG: &str = include_str!("../config.json"); @@ -80,7 +81,7 @@ async fn main() { { let api_state = ltc_state.clone(); let offset_clone = hw_offset.clone(); - tokio::spawn(async move { + task::spawn_local(async move { if let Err(e) = start_api_server(api_state, offset_clone).await { eprintln!("API server error: {}", e); }