mirror of
https://github.com/cjfranko/NTP-Timeturner.git
synced 2025-11-08 18:32:02 +00:00
fix: Set tokio runtime to current_thread to fix !Send errors
Co-authored-by: aider (gemini/gemini-2.5-pro-preview-05-06) <aider@aider.chat>
This commit is contained in:
parent
8ad553aaee
commit
0325c3b570
2 changed files with 4 additions and 4 deletions
|
|
@ -67,7 +67,7 @@ async fn get_status(data: web::Data<AppState>) -> impl Responder {
|
||||||
let lock_ratio = state.lock_ratio();
|
let lock_ratio = state.lock_ratio();
|
||||||
|
|
||||||
let ntp_active = ui::ntp_service_active();
|
let ntp_active = ui::ntp_service_active();
|
||||||
let interfaces = get_if_addrs::get_if_addrs()
|
let interfaces = get_if_addrs()
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|ifa| !ifa.is_loopback())
|
.filter(|ifa| !ifa.is_loopback())
|
||||||
|
|
@ -86,7 +86,7 @@ async fn get_status(data: web::Data<AppState>) -> impl Responder {
|
||||||
lock_ratio,
|
lock_ratio,
|
||||||
ntp_active,
|
ntp_active,
|
||||||
interfaces,
|
interfaces,
|
||||||
hardware_offset_ms,
|
hardware_offset_ms: hw_offset_ms,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ struct ConfigResponse {
|
||||||
#[get("/api/config")]
|
#[get("/api/config")]
|
||||||
async fn get_config(data: web::Data<AppState>) -> impl Responder {
|
async fn get_config(data: web::Data<AppState>) -> impl Responder {
|
||||||
let hw_offset_ms = *data.hw_offset.lock().unwrap();
|
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)]
|
#[derive(Deserialize)]
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ fn ensure_config() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
// 🔄 Ensure there's always a config.json present
|
// 🔄 Ensure there's always a config.json present
|
||||||
ensure_config();
|
ensure_config();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue