diff --git a/backend/src/tasks/lights.rs b/backend/src/tasks/lights.rs index d06a3ee..b424752 100644 --- a/backend/src/tasks/lights.rs +++ b/backend/src/tasks/lights.rs @@ -105,12 +105,12 @@ pub async fn lights_task(state: &State) { schedule.insert(day, time); } else { - schedule.remove(&day); + schedule.remove(&day); } }).await { error!("Failed to save wake schedule: {e}"); }; - + if let Some(time) = time { let handle = spawn(wake_task( state.client_message.subscribe(), @@ -119,7 +119,7 @@ pub async fn lights_task(state: &State) { day, time, )); - + if let Some(old_handle) = wake_tasks.insert((id, day), handle) { old_handle.abort(); }} else {