Skip to content

Commit

Permalink
Merge pull request #104 from damianh/exited-successfully-only
Browse files Browse the repository at this point in the history
Stop waiting on ExitedWithError
  • Loading branch information
damianh authored Sep 25, 2020
2 parents cfdba1c + aa4cc0b commit 438d3d7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/LittleForker/ProcessSupervisor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,7 @@ private async Task OnStop(TimeSpan? timeout)
// only means the process has _started_ to shut down.

await CooperativeShutdown.SignalExit(ProcessInfo.Id, _loggerFactory).TimeoutAfter(timeout.Value);
var exited = this.WhenStateIs(State.ExitedSuccessfully);
var exitedWithError = this.WhenStateIs(State.ExitedWithError);

await Task
.WhenAny(exited, exitedWithError)
.TimeoutAfter(timeout.Value);
await this.WhenStateIs(State.ExitedSuccessfully).TimeoutAfter(timeout.Value);
}
catch (TimeoutException)
{
Expand Down

0 comments on commit 438d3d7

Please sign in to comment.