mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Use generic delay for all unhandled disconnects
There are only handful of cases where we want to reconnect immediately, and login limiter delay usually kills those anyway
This commit is contained in:
@@ -2384,18 +2384,10 @@ public sealed class Bot : IAsyncDisposable {
|
||||
// Do not attempt to reconnect, those failures are permanent
|
||||
return;
|
||||
case EResult.InvalidPassword when !string.IsNullOrEmpty(BotDatabase.LoginKey):
|
||||
// We can retry immediately
|
||||
BotDatabase.LoginKey = null;
|
||||
ArchiLogger.LogGenericInfo(Strings.BotRemovedExpiredLoginKey);
|
||||
|
||||
break;
|
||||
case EResult.InvalidPassword:
|
||||
case EResult.NoConnection:
|
||||
case EResult.ServiceUnavailable:
|
||||
case EResult.Timeout:
|
||||
case EResult.TryAnotherCM:
|
||||
case EResult.TwoFactorCodeMismatch:
|
||||
await Task.Delay(5000).ConfigureAwait(false);
|
||||
|
||||
break;
|
||||
case EResult.RateLimitExceeded:
|
||||
ArchiLogger.LogGenericInfo(string.Format(CultureInfo.CurrentCulture, Strings.BotRateLimitExceeded, TimeSpan.FromMinutes(LoginCooldownInMinutes).ToHumanReadable()));
|
||||
@@ -2410,6 +2402,11 @@ public sealed class Bot : IAsyncDisposable {
|
||||
ASF.LoginRateLimitingSemaphore.Release();
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
// Generic delay before retrying
|
||||
await Task.Delay(5000).ConfigureAwait(false);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user