diff options
author | FxQnLr <[email protected]> | 2023-10-24 14:56:17 +0200 |
---|---|---|
committer | FxQnLr <[email protected]> | 2023-10-24 14:56:17 +0200 |
commit | f9224ff02e688dec819ab81893320a0611f2a198 (patch) | |
tree | bfb5376bfb563c295737aba2783c3e0c2ac1b924 /src/routes | |
parent | dcfb83fb2069bfcf4642b03453253e35479bf3da (diff) | |
download | webol-f9224ff02e688dec819ab81893320a0611f2a198.tar webol-f9224ff02e688dec819ab81893320a0611f2a198.tar.gz webol-f9224ff02e688dec819ab81893320a0611f2a198.zip |
Seems to work
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) |