Slightly modify Restart()

This fixes potential ultra-rare race condition of new process WCF being unable to bind to listening socket due to old process stil occupying it
This commit is contained in:
JustArchi
2016-07-18 11:03:13 +02:00
parent 39bc1fe719
commit bfd37b4c06

View File

@@ -257,19 +257,21 @@ namespace ArchiSteamFarm {
}
}
internal static void Exit(int exitCode = 0) {
internal static void Exit(byte exitCode = 0) {
Shutdown();
Environment.Exit(exitCode);
}
internal static void Restart() {
Shutdown();
try {
Process.Start(ExecutableFile, string.Join(" ", Environment.GetCommandLineArgs().Skip(1)));
} catch (Exception e) {
Logging.LogGenericException(e);
}
Exit();
Environment.Exit(0);
}
internal static string GetUserInput(EUserInputType userInputType, string botName = ASF, string extraInformation = null) {