try more drastic measures to terminate current process inside Docker

This commit is contained in:
13xforever 2020-04-03 21:32:13 +05:00
parent 84d010bbbe
commit d3036028a2

View File

@ -274,7 +274,11 @@ namespace CompatBot
&& eventArgs.Message.Contains("Reconnect"))
{
Config.Log.Warn("Detected the new discord gateway opcode, restarting...");
Sudo.Bot.Restart(InvalidChannelId, "Restarted due to issues with the new Discord gateway opcode issues");
var restartThread = new Thread(() => Sudo.Bot.Restart(InvalidChannelId, "Restarted due to issues with the new Discord gateway opcode issues"));
restartThread.Start();
restartThread.Join(100);
if (SandboxDetector.Detect() == SandboxType.Docker)
Environment.Exit(-1);
}
}
else if (eventArgs.Level == LogLevel.Warning)