summaryrefslogtreecommitdiff
path: root/src/routes/start.rs
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2023-10-24 14:56:17 +0200
committerFxQnLr <[email protected]>2023-10-24 14:56:17 +0200
commitf9224ff02e688dec819ab81893320a0611f2a198 (patch)
treebfb5376bfb563c295737aba2783c3e0c2ac1b924 /src/routes/start.rs
parentdcfb83fb2069bfcf4642b03453253e35479bf3da (diff)
downloadwebol-f9224ff02e688dec819ab81893320a0611f2a198.tar
webol-f9224ff02e688dec819ab81893320a0611f2a198.tar.gz
webol-f9224ff02e688dec819ab81893320a0611f2a198.zip
Seems to work
Diffstat (limited to 'src/routes/start.rs')
-rw-r--r--src/routes/start.rs10
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};
4use std::sync::Arc; 4use std::sync::Arc;
5use axum::extract::State; 5use axum::extract::State;
6use serde_json::{json, Value}; 6use serde_json::{json, Value};
7use tracing::info; 7use tracing::{debug, info};
8use crate::auth::auth; 8use crate::auth::auth;
9use crate::config::SETTINGS; 9use crate::config::SETTINGS;
10use crate::wol::{create_buffer, send_packet}; 10use 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)