summaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2023-10-30 12:22:31 +0100
committerFxQnLr <[email protected]>2023-10-30 12:22:31 +0100
commit348cf5fbe4527865e8aa5cb719fd8790f4d8953e (patch)
treebddbd1dbc366f95861a6bdf99607fff46ff6133c /src/routes
parente3b622f5a918f6a4b5c3b67198ee7b72ef06062d (diff)
downloadwebol-348cf5fbe4527865e8aa5cb719fd8790f4d8953e.tar
webol-348cf5fbe4527865e8aa5cb719fd8790f4d8953e.tar.gz
webol-348cf5fbe4527865e8aa5cb719fd8790f4d8953e.zip
changed pingmap tuple to own struct
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/start.rs3
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;
11use crate::wol::{create_buffer, send_packet}; 11use crate::wol::{create_buffer, send_packet};
12use crate::db::Device; 12use crate::db::Device;
13use crate::error::WebolError; 13use crate::error::WebolError;
14use crate::services::ping::PingValue;
14 15
15#[axum_macros::debug_handler] 16#[axum_macros::debug_handler]
16pub async fn start(State(state): State<Arc<crate::AppState>>, headers: HeaderMap, Json(payload): Json<StartPayload>) -> Result<Json<Value>, WebolError> { 17pub 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