diff options
Diffstat (limited to 'src/routes')
-rw-r--r-- | src/routes/start.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/routes/start.rs b/src/routes/start.rs index b45fe5b..863ef16 100644 --- a/src/routes/start.rs +++ b/src/routes/start.rs | |||
@@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize}; | |||
4 | use std::sync::Arc; | 4 | use std::sync::Arc; |
5 | use axum::extract::State; | 5 | use axum::extract::State; |
6 | use serde_json::{json, Value}; | 6 | use serde_json::{json, Value}; |
7 | use tracing::info; | 7 | use tracing::{debug, info}; |
8 | use crate::auth::auth; | 8 | use crate::auth::auth; |
9 | use crate::config::SETTINGS; | 9 | use crate::config::SETTINGS; |
10 | use crate::wol::{create_buffer, send_packet}; | 10 | use crate::wol::{create_buffer, send_packet}; |
@@ -39,8 +39,12 @@ pub async fn start(State(state): State<Arc<crate::AppState>>, headers: HeaderMap | |||
39 | )?; | 39 | )?; |
40 | 40 | ||
41 | if payload.ping.is_some_and(|ping| ping) { | 41 | if payload.ping.is_some_and(|ping| ping) { |
42 | tokio::spawn(async move {crate::services::ping::spawn(state.ping_send.clone()).await}); | 42 | debug!("ping true"); |
43 | } | 43 | tokio::spawn(async move { |
44 | debug!("Init ping service"); | ||
45 | crate::services::ping::spawn(state.ping_send.clone()).await | ||
46 | }); | ||
47 | }; | ||
44 | Ok(Json(json!(StartResponse { id: device.id, boot: true }))) | 48 | Ok(Json(json!(StartResponse { id: device.id, boot: true }))) |
45 | } else { | 49 | } else { |
46 | Err(WebolError::Generic) | 50 | Err(WebolError::Generic) |