diff options
Diffstat (limited to 'src/routes/start.rs')
-rw-r--r-- | src/routes/start.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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; | |||
11 | use crate::wol::{create_buffer, send_packet}; | 11 | use crate::wol::{create_buffer, send_packet}; |
12 | use crate::db::Device; | 12 | use crate::db::Device; |
13 | use crate::error::WebolError; | 13 | use crate::error::WebolError; |
14 | use crate::services::ping::PingValue; | ||
14 | 15 | ||
15 | #[axum_macros::debug_handler] | 16 | #[axum_macros::debug_handler] |
16 | pub async fn start(State(state): State<Arc<crate::AppState>>, headers: HeaderMap, Json(payload): Json<StartPayload>) -> Result<Json<Value>, WebolError> { | 17 | pub async fn start(State(state): State<Arc<crate::AppState>>, headers: HeaderMap, Json(payload): Json<StartPayload>) -> Result<Json<Value>, WebolError> { |
@@ -46,7 +47,7 @@ pub async fn start(State(state): State<Arc<crate::AppState>>, headers: HeaderMap | |||
46 | let uuid_genc = uuid_gen.clone(); | 47 | let uuid_genc = uuid_gen.clone(); |
47 | tokio::spawn(async move { | 48 | tokio::spawn(async move { |
48 | debug!("Init ping service"); | 49 | debug!("Init ping service"); |
49 | state.ping_map.insert(uuid_gen.clone(), (device.ip.clone(), false)); | 50 | state.ping_map.insert(uuid_gen.clone(), PingValue { ip: device.ip.clone(), online: false }); |
50 | 51 | ||
51 | warn!("{:?}", state.ping_map); | 52 | warn!("{:?}", state.ping_map); |
52 | 53 | ||