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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
1 deletions
-
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++; |
|
|
|
|