Schedule semaphore release in background

This commit is contained in:
JustArchi
2016-02-05 20:15:28 +01:00
parent f86bc32f0d
commit 6a172ce269
2 changed files with 8 additions and 4 deletions

View File

@@ -104,8 +104,10 @@ namespace ArchiSteamFarm {
internal static async Task LimitSteamRequestsAsync() {
await SteamSemaphore.WaitAsync().ConfigureAwait(false);
await Utilities.SleepAsync(5 * 1000).ConfigureAwait(false); // We must add some delay to not get caught by Steam rate limiter
SteamSemaphore.Release();
var releaseLater = Task.Run(async () => {
await Utilities.SleepAsync(5000).ConfigureAwait(false); // We must add some delay to not get caught by Steam rate limiter
SteamSemaphore.Release();
});
}
internal static string GetUserInput(string botLogin, EUserInputType userInputType, string extraInformation = null) {

View File

@@ -39,8 +39,10 @@ namespace ArchiSteamFarm {
internal static async Task LimitInventoryRequestsAsync() {
await InventorySemaphore.WaitAsync().ConfigureAwait(false);
await Utilities.SleepAsync(3000).ConfigureAwait(false); // We must add some delay to not get caught by Steam rate limiter
InventorySemaphore.Release();
var releaseLater = Task.Run(async () => {
await Utilities.SleepAsync(3000).ConfigureAwait(false); // We must add some delay to not get caught by Steam rate limiter
InventorySemaphore.Release();
});
}
internal Trading(Bot bot) {