mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Don't launch all parallel tasks immediately
It seems that the runtime is actually smarter than I thought, and can optimize tasks creation for maximum performance better than we'd do
This commit is contained in:
@@ -107,9 +107,7 @@ namespace ArchiSteamFarm {
|
||||
}
|
||||
}
|
||||
|
||||
List<Task<ParseTradeResult>> tasks = tradeOffers.Select(ParseTrade).ToList();
|
||||
ParseTradeResult[] results = await Task.WhenAll(tasks).ConfigureAwait(false);
|
||||
|
||||
ParseTradeResult[] results = await Task.WhenAll(tradeOffers.Select(ParseTrade)).ConfigureAwait(false);
|
||||
if (results.Any(result => result == ParseTradeResult.AcceptedWithItemLose)) {
|
||||
await Task.Delay(1000).ConfigureAwait(false); // Sometimes we can be too fast for Steam servers to generate confirmations, wait a short moment
|
||||
HashSet<ulong> tradeIDs = new HashSet<ulong>(tradeOffers.Select(tradeOffer => tradeOffer.TradeOfferID));
|
||||
|
||||
Reference in New Issue
Block a user