From e028ce62b0ae4865bc9546457aa3905082b81bd5 Mon Sep 17 00:00:00 2001 From: LastExceed Date: Sat, 15 Feb 2025 08:16:05 +0100 Subject: [PATCH] fix slaves with `runsContinuously` getting shutdown on master release when another dependent master is booked but not running --- src/state/listener.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/state/listener.rs b/src/state/listener.rs index 431d699..3450584 100644 --- a/src/state/listener.rs +++ b/src/state/listener.rs @@ -141,8 +141,14 @@ impl State { .read() .await .iter() - .filter(|(other, booking)| *other != master && booking.is_running()) - .flat_map(|(machine, _)| SLAVES_BY_MASTER.get(machine).unwrap_or(&fallback)) //machine being unknown already got logged when it got turned on, so we can ignore it here + .filter(|(other, _booking)| *other != master) + .flat_map(|(machine, booking)| + SLAVES_BY_MASTER + .get(machine) + .unwrap_or(&fallback) // machine being unknown already got logged when it got turned on, so we can ignore it here + .iter() + .filter(|slave| booking.is_running() || SLAVE_PROPERTIES[*slave][index::RUNS_CONTINUOUSLY]) + ) .cloned() .collect();