summaryrefslogtreecommitdiff
path: root/src/routes/start.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes/start.rs')
-rw-r--r--src/routes/start.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/routes/start.rs b/src/routes/start.rs
index 45e7ec8..b1c8a73 100644
--- a/src/routes/start.rs
+++ b/src/routes/start.rs
@@ -44,15 +44,16 @@ pub async fn start(State(state): State<Arc<crate::AppState>>, headers: HeaderMap
44 let uuid = if payload.ping.is_some_and(|ping| ping) { 44 let uuid = if payload.ping.is_some_and(|ping| ping) {
45 let uuid_gen = Uuid::new_v4().to_string(); 45 let uuid_gen = Uuid::new_v4().to_string();
46 let uuid_genc = uuid_gen.clone(); 46 let uuid_genc = uuid_gen.clone();
47 let uuid_gencc = 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.lock().await.insert(uuid_gen, ("192.168.178.94".to_string(), false)); 50 state.ping_map.lock().await.insert(uuid_gen, ("192.168.178.94".to_string(), false));
50 51
51 warn!("{:?}", state.ping_map); 52 warn!("{:?}", state.ping_map);
52 53
53 crate::services::ping::spawn(state.ping_send.clone(), "192.168.178.94".to_string()).await; 54 crate::services::ping::spawn(state.ping_send.clone(), "192.168.178.94".to_string(), uuid_genc.clone(), state.ping_map.clone()).await
54 }); 55 });
55 Some(uuid_genc) 56 Some(uuid_gencc)
56 } else { None }; 57 } else { None };
57 Ok(Json(json!(StartResponse { id: device.id, boot: true, uuid }))) 58 Ok(Json(json!(StartResponse { id: device.id, boot: true, uuid })))
58 } else { 59 } else {