From 3203daf787fc797063b16eb04811f8a1f13cfadd Mon Sep 17 00:00:00 2001 From: JustArchi Date: Tue, 9 Jun 2020 19:45:12 +0200 Subject: [PATCH] Remove PICSSemaphore It should be no longer needed --- ArchiSteamFarm/Bot.cs | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index edecc957b..93b349ee1 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -130,7 +130,6 @@ namespace ArchiSteamFarm { private readonly SemaphoreSlim InitializationSemaphore = new SemaphoreSlim(1, 1); private readonly SemaphoreSlim MessagingSemaphore = new SemaphoreSlim(1, 1); private readonly ConcurrentDictionary PastNotifications = new ConcurrentDictionary(); - private readonly SemaphoreSlim PICSSemaphore = new SemaphoreSlim(1, 1); private readonly Statistics Statistics; private readonly SteamClient SteamClient; private readonly ConcurrentHashSet SteamFamilySharingIDs = new ConcurrentHashSet(); @@ -306,7 +305,6 @@ namespace ArchiSteamFarm { GamesRedeemerInBackgroundSemaphore.Dispose(); InitializationSemaphore.Dispose(); MessagingSemaphore.Dispose(); - PICSSemaphore.Dispose(); Trading.Dispose(); await Actions.DisposeAsync().ConfigureAwait(false); @@ -671,14 +669,10 @@ namespace ArchiSteamFarm { AsyncJobMultiple.ResultSet productInfoResultSet = null; for (byte i = 0; (i < WebBrowser.MaxTries) && (productInfoResultSet == null) && IsConnectedAndLoggedOn; i++) { - await PICSSemaphore.WaitAsync().ConfigureAwait(false); - try { productInfoResultSet = await SteamApps.PICSGetProductInfo(appID, null, false); } catch (Exception e) { ArchiLogger.LogGenericWarningException(e); - } finally { - PICSSemaphore.Release(); } } @@ -831,14 +825,10 @@ namespace ArchiSteamFarm { AsyncJobMultiple.ResultSet productInfoResultSet = null; for (byte i = 0; (i < WebBrowser.MaxTries) && (productInfoResultSet == null) && IsConnectedAndLoggedOn; i++) { - await PICSSemaphore.WaitAsync().ConfigureAwait(false); - try { productInfoResultSet = await SteamApps.PICSGetProductInfo(Enumerable.Empty(), packageIDs.Select(packageID => new SteamApps.PICSRequest(packageID, OwnedPackageIDs.TryGetValue(packageID, out (EPaymentMethod PaymentMethod, DateTime TimeCreated, ulong AccessToken) value) ? value.AccessToken : 0, false))); } catch (Exception e) { ArchiLogger.LogGenericWarningException(e); - } finally { - PICSSemaphore.Release(); } }