Browse Source

Delay instead of sleep with cancellation (#186)

- This lets ctrl+c work faster
pull/191/head
David Fowler 6 years ago
committed by GitHub
parent
commit
486fbb11b9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/Microsoft.Tye.Hosting/ProcessRunner.cs

9
src/Microsoft.Tye.Hosting/ProcessRunner.cs

@ -226,7 +226,14 @@ namespace Microsoft.Tye.Hosting
{
_logger.LogError(0, ex, "Failed to launch process for service {ServiceName}", replica);
Thread.Sleep(5000);
try
{
await Task.Delay(5000, processInfo.StoppedTokenSource.Token);
}
catch (OperationCanceledException)
{
// Swallow cancellation exceptions and continue
}
}
service.Restarts++;

Loading…
Cancel
Save