Always apply Both outcomes, even when the first fails

This commit is contained in:
Félix Saparelli 2021-09-03 05:41:21 +12:00
parent 8e4994abca
commit f880b0b38a
No known key found for this signature in database
GPG Key ID: B948C4BAE44FC474

View File

@ -321,6 +321,7 @@ async fn apply_outcome(
errors: mpsc::Sender<RuntimeError>, errors: mpsc::Sender<RuntimeError>,
events: mpsc::Sender<Event>, events: mpsc::Sender<Event>,
) -> Result<(), RuntimeError> { ) -> Result<(), RuntimeError> {
trace!(?outcome, "applying outcome");
match (process.as_mut(), outcome) { match (process.as_mut(), outcome) {
(_, Outcome::DoNothing) => {} (_, Outcome::DoNothing) => {}
(_, Outcome::Exit) => { (_, Outcome::Exit) => {
@ -409,7 +410,7 @@ async fn apply_outcome(
} }
(_, Outcome::Both(one, two)) => { (_, Outcome::Both(one, two)) => {
apply_outcome( if let Err(err) = apply_outcome(
*one, *one,
working.clone(), working.clone(),
process, process,
@ -418,7 +419,14 @@ async fn apply_outcome(
errors.clone(), errors.clone(),
events.clone(), events.clone(),
) )
.await?; .await
{
debug!(
"first outcome failed, sending an error but proceeding to the second anyway"
);
errors.send(err).await.ok();
}
apply_outcome( apply_outcome(
*two, *two,
working, working,