mirror of
https://github.com/JKorf/CryptoExchange.Net
synced 2025-06-08 00:16:27 +00:00
used async await for tasks instead of WaitAll
This commit is contained in:
parent
a525709562
commit
a5a7c4ed1d
@ -552,7 +552,7 @@ namespace CryptoExchange.Net
|
|||||||
{
|
{
|
||||||
log.Write(LogVerbosity.Debug, $"Closing all {sockets.Sum(s => s.Value.HandlerCount)} subscriptions");
|
log.Write(LogVerbosity.Debug, $"Closing all {sockets.Sum(s => s.Value.HandlerCount)} subscriptions");
|
||||||
|
|
||||||
await Task.Run(() =>
|
await Task.Run(async () =>
|
||||||
{
|
{
|
||||||
var tasks = new List<Task>();
|
var tasks = new List<Task>();
|
||||||
{
|
{
|
||||||
@ -561,7 +561,7 @@ namespace CryptoExchange.Net
|
|||||||
tasks.Add(sub.Close());
|
tasks.Add(sub.Close());
|
||||||
}
|
}
|
||||||
|
|
||||||
Task.WaitAll(tasks.ToArray());
|
await Task.WhenAll(tasks.ToArray()).ConfigureAwait(false);
|
||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user