mirror of
https://github.com/watchexec/watchexec.git
synced 2024-09-29 14:41:35 +02:00
Resolve compound outcomes
This commit is contained in:
parent
7a709b9b4d
commit
d2d0bb7be2
@ -121,6 +121,13 @@ impl Outcome {
|
|||||||
Self::Both(Box::new(one), Box::new(two))
|
Self::Both(Box::new(one), Box::new(two))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn resolve(self, is_running: bool) -> Self {
|
||||||
|
match (is_running, self) {
|
||||||
|
(true, Self::IfRunning(then, _)) => then.resolve(true),
|
||||||
|
(false, Self::IfRunning(_, otherwise)) => otherwise.resolve(false),
|
||||||
|
(ir, Self::Both(one, two)) => Self::both(one.resolve(ir), two.resolve(ir)),
|
||||||
|
(_, other) => other,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -178,6 +185,11 @@ pub async fn worker(
|
|||||||
|
|
||||||
let outcome = outcome.get().cloned().unwrap_or_default();
|
let outcome = outcome.get().cloned().unwrap_or_default();
|
||||||
debug!(?outcome, "handler finished");
|
debug!(?outcome, "handler finished");
|
||||||
|
|
||||||
|
let is_running = todo!();
|
||||||
|
|
||||||
|
let outcome = outcome.resolve(is_running);
|
||||||
|
debug!(?outcome, "outcome resolved");
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("action worker finished");
|
debug!("action worker finished");
|
||||||
|
Loading…
Reference in New Issue
Block a user