Windows Tray/Serice update improvements

This commit is contained in:
flightlevel
2018-06-26 19:44:12 +10:00
parent 28bbeec462
commit 060972475f
7 changed files with 100 additions and 17 deletions

View File

@@ -77,10 +77,12 @@ namespace Jackett.Service
private void ProcessExited(object sender, EventArgs e)
{
logger.Info("Console process exited");
if (!serviceStopInitiated)
{
logger.Info("Service stop not responsible for process exit");
OnStop();
Stop();
}
}
@@ -89,7 +91,7 @@ namespace Jackett.Service
if (consoleProcess != null && !consoleProcess.HasExited)
{
consoleProcess.StandardInput.Close();
System.Threading.Thread.Sleep(1000);
consoleProcess.WaitForExit(2000);
if (consoleProcess != null && !consoleProcess.HasExited)
{
consoleProcess.Kill();