From 348cf5fbe4527865e8aa5cb719fd8790f4d8953e Mon Sep 17 00:00:00 2001 From: FxQnLr Date: Mon, 30 Oct 2023 12:22:31 +0100 Subject: changed pingmap tuple to own struct --- src/routes/start.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/routes/start.rs') diff --git a/src/routes/start.rs b/src/routes/start.rs index 3bccb0f..c2c9378 100644 --- a/src/routes/start.rs +++ b/src/routes/start.rs @@ -11,6 +11,7 @@ use crate::config::SETTINGS; use crate::wol::{create_buffer, send_packet}; use crate::db::Device; use crate::error::WebolError; +use crate::services::ping::PingValue; #[axum_macros::debug_handler] pub async fn start(State(state): State>, headers: HeaderMap, Json(payload): Json) -> Result, WebolError> { @@ -46,7 +47,7 @@ pub async fn start(State(state): State>, headers: HeaderMap let uuid_genc = uuid_gen.clone(); tokio::spawn(async move { debug!("Init ping service"); - state.ping_map.insert(uuid_gen.clone(), (device.ip.clone(), false)); + state.ping_map.insert(uuid_gen.clone(), PingValue { ip: device.ip.clone(), online: false }); warn!("{:?}", state.ping_map); -- cgit v1.2.3