mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
fix connectivity check cancellation
This commit is contained in:
parent
9edd5fe2da
commit
d74511b334
@ -86,7 +86,7 @@
|
|||||||
|
|
||||||
if (finishedTask.IsFaulted)
|
if (finishedTask.IsFaulted)
|
||||||
exceptions.Add(finishedTask.Exception!.InnerException!);
|
exceptions.Add(finishedTask.Exception!.InnerException!);
|
||||||
else
|
else if (!finishedTask.IsCanceled)
|
||||||
BaseUrl = finishedTask.Result;
|
BaseUrl = finishedTask.Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +94,11 @@
|
|||||||
tokenSource.Cancel();
|
tokenSource.Cancel();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(BaseUrl))
|
if (string.IsNullOrEmpty(BaseUrl))
|
||||||
return exceptions[0];
|
{
|
||||||
|
if (exceptions.Any())
|
||||||
|
return exceptions[0];
|
||||||
|
return new TaskCanceledException("All tasks have been cancelled"); // we can't add TaskCanceledExceptions to the list
|
||||||
|
}
|
||||||
|
|
||||||
App.Logger.WriteLine(LOG_IDENT, $"Got {BaseUrl} as the optimal base URL");
|
App.Logger.WriteLine(LOG_IDENT, $"Got {BaseUrl} as the optimal base URL");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user