mirror of
https://github.com/watchexec/watchexec.git
synced 2024-09-29 22:51:33 +02:00
Always apply Both outcomes, even when the first fails
This commit is contained in:
parent
8e4994abca
commit
f880b0b38a
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user