Fix rare restart issue

This commit is contained in:
JustArchi
2016-03-22 08:53:55 +01:00
parent 7d3c05088a
commit 7276350f74
3 changed files with 16 additions and 6 deletions

View File

@@ -303,7 +303,11 @@ namespace ArchiSteamFarm {
}
}
internal async Task Restart() {
internal async Task RestartIfRunning() {
if (!SteamClient.IsConnected) {
return;
}
await Stop().ConfigureAwait(false);
await Start().ConfigureAwait(false);
}
@@ -1563,7 +1567,7 @@ namespace ArchiSteamFarm {
}
if (!await ArchiWebHandler.Init(SteamClient, callback.WebAPIUserNonce, BotConfig.SteamParentalPIN).ConfigureAwait(false)) {
await Restart().ConfigureAwait(false);
await RestartIfRunning().ConfigureAwait(false);
return;
}