diff --git a/src/api.rs b/src/api.rs index e1c641a..0ae4edd 100644 --- a/src/api.rs +++ b/src/api.rs @@ -67,7 +67,7 @@ async fn get_status(data: web::Data) -> impl Responder { let lock_ratio = state.lock_ratio(); let ntp_active = ui::ntp_service_active(); - let interfaces = get_if_addrs::get_if_addrs() + let interfaces = get_if_addrs() .unwrap_or_default() .into_iter() .filter(|ifa| !ifa.is_loopback()) @@ -86,7 +86,7 @@ async fn get_status(data: web::Data) -> impl Responder { lock_ratio, ntp_active, interfaces, - hardware_offset_ms, + hardware_offset_ms: hw_offset_ms, }) } @@ -112,7 +112,7 @@ struct ConfigResponse { #[get("/api/config")] async fn get_config(data: web::Data) -> impl Responder { let hw_offset_ms = *data.hw_offset.lock().unwrap(); - HttpResponse::Ok().json(ConfigResponse { hardware_offset_ms }) + HttpResponse::Ok().json(ConfigResponse { hardware_offset_ms: hw_offset_ms }) } #[derive(Deserialize)] diff --git a/src/main.rs b/src/main.rs index 1b9d9b4..2014fab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,7 +32,7 @@ fn ensure_config() { } } -#[tokio::main] +#[tokio::main(flavor = "current_thread")] async fn main() { // 🔄 Ensure there's always a config.json present ensure_config();