Prevent UnobservedTaskException in LeaderElector (#1420)
* Prevent UnobservedTaskException in LeaderElector * Loggin exception
This commit is contained in:
committed by
GitHub
parent
7b6d1d8cc1
commit
7cdebbf516
@@ -211,8 +211,11 @@ namespace k8s.LeaderElection
|
||||
// wait RetryPeriod since acq return immediately
|
||||
await Task.Delay(delay, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
// else timeout
|
||||
else
|
||||
{
|
||||
// else timeout
|
||||
_ = acq.ContinueWith(t => OnError?.Invoke(t.Exception), TaskContinuationOptions.OnlyOnFaulted);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user