Run API calls in their own tasks

Those SK2 calls are synchronous after all, and they might affect responsiveness negatively when a single bot is executing many of them.
This is once again not a problem of ASF, as here we can have like 1-2 concurrent API calls, but ArchiBoT suffered from this a lot.
This commit is contained in:
JustArchi
2017-03-12 07:40:22 +01:00
parent 7864a86324
commit 9b2380fdf9
2 changed files with 73 additions and 63 deletions

View File

@@ -366,7 +366,7 @@ namespace ArchiSteamFarm {
return (uint) (Utilities.GetUnixTime() + SteamTimeDifference.Value);
}
uint serverTime = Bot.ArchiWebHandler.GetServerTime();
uint serverTime = await Bot.ArchiWebHandler.GetServerTime().ConfigureAwait(false);
if (serverTime == 0) {
return Utilities.GetUnixTime();
}