fix slaves with runsContinuously getting shutdown on master release when another dependent master is booked but not running

This commit is contained in:
LastExceed 2025-02-15 08:16:05 +01:00
parent 6f65853617
commit e028ce62b0

View File

@ -141,8 +141,14 @@ impl State<Listener> {
.read() .read()
.await .await
.iter() .iter()
.filter(|(other, booking)| *other != master && booking.is_running()) .filter(|(other, _booking)| *other != master)
.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 .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() .cloned()
.collect(); .collect();