From a540f242088622a3c483f7684deb3655900db1df Mon Sep 17 00:00:00 2001 From: JustArchi Date: Mon, 18 Jun 2018 12:12:18 +0200 Subject: [PATCH] Do not run boosters unpack in parallel https://steamcommunity.com/groups/ascfarm/discussions/1/3559414588264550284/ --- ArchiSteamFarm/Bot.cs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 48d2d1eb3..c57ab9ab7 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -5015,19 +5015,10 @@ namespace ArchiSteamFarm { return FormatBotResponse(string.Format(Strings.ErrorIsEmpty, nameof(inventory))); } - IEnumerable> tasks = inventory.Select(item => ArchiWebHandler.UnpackBooster(item.RealAppID, item.AssetID)); - // It'd make sense here to actually check return code of ArchiWebHandler.UnpackBooster(), but it lies most of the time | https://github.com/JustArchi/ArchiSteamFarm/issues/704 - switch (Program.GlobalConfig.OptimizationMode) { - case GlobalConfig.EOptimizationMode.MinMemoryUsage: - foreach (Task task in tasks) { - await task.ConfigureAwait(false); - } - - break; - default: - await Task.WhenAll(tasks).ConfigureAwait(false); - break; + // It'd also make sense to run all of this in parallel, but it seems that Steam has a lot of problems with inventory-related parallel requests | https://steamcommunity.com/groups/ascfarm/discussions/1/3559414588264550284/ + foreach (Steam.Asset item in inventory) { + await ArchiWebHandler.UnpackBooster(item.RealAppID, item.AssetID).ConfigureAwait(false); } return FormatBotResponse(Strings.Done);