Fix crashes and save issues

This commit is contained in:
John Gross
2017-07-31 13:12:01 -07:00
parent 525b496774
commit 2f3b6cdda7
9 changed files with 25 additions and 14 deletions

View File

@@ -84,10 +84,14 @@ namespace Torch.Server
{
var pid = int.Parse(_config.WaitForPID);
var waitProc = Process.GetProcessById(pid);
_log.Warn($"Waiting for process {pid} to exit.");
waitProc.WaitForExit();
_log.Info("Continuing in 5 seconds.");
Thread.Sleep(5000);
if (!waitProc.HasExited)
{
_log.Warn($"Killing old process {pid}.");
waitProc.Kill();
}
}
catch
{