Misc optimization

This commit is contained in:
JustArchi
2021-04-23 00:25:30 +02:00
parent ac2551987a
commit 8248864133

View File

@@ -254,12 +254,20 @@ namespace ArchiSteamFarm {
internal void Init(Bot bot) => Bot = bot ?? throw new ArgumentNullException(nameof(bot));
internal static async Task ResetSteamTimeDifference() {
if ((SteamTimeDifference == null) && (LastSteamTimeCheck == DateTime.MinValue)) {
return;
}
if (!await TimeSemaphore.WaitAsync(0).ConfigureAwait(false)) {
// Resolve or reset is already in-progress
return;
}
try {
if ((SteamTimeDifference == null) && (LastSteamTimeCheck == DateTime.MinValue)) {
return;
}
SteamTimeDifference = null;
LastSteamTimeCheck = DateTime.MinValue;
} finally {