mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
better process cleanup on automation teardown
This commit is contained in:
parent
b2a042bd30
commit
7e7835f3f7
@ -110,14 +110,11 @@ private void StartNzbDrone()
|
||||
|
||||
private void StopNzbDrone()
|
||||
{
|
||||
foreach (var process in Process.GetProcessesByName("nzbdrone"))
|
||||
{
|
||||
process.Kill();
|
||||
process.WaitForExit();
|
||||
}
|
||||
|
||||
foreach (var process in Process.GetProcessesByName("iisexpress"))
|
||||
foreach (var process in Process.GetProcesses())
|
||||
{
|
||||
if (string.Equals(process.ProcessName, "NzbDrone", StringComparison.InvariantCultureIgnoreCase)
|
||||
|| string.Equals(process.ProcessName, "IISExpress", StringComparison.InvariantCultureIgnoreCase))
|
||||
process.Kill();
|
||||
process.WaitForExit();
|
||||
}
|
||||
@ -126,9 +123,15 @@ private void StopNzbDrone()
|
||||
{
|
||||
StartProcess("ServiceUninstall.exe", true);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
catch { }
|
||||
|
||||
foreach (var process in Process.GetProcesses())
|
||||
{
|
||||
if (string.Equals(process.ProcessName, "NzbDrone", StringComparison.InvariantCultureIgnoreCase)
|
||||
|| string.Equals(process.ProcessName, "IISExpress", StringComparison.InvariantCultureIgnoreCase)
|
||||
|| string.Equals(process.ProcessName, "ServiceUninstall", StringComparison.InvariantCultureIgnoreCase))
|
||||
process.Kill();
|
||||
process.WaitForExit();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user