1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-20 21:55:03 -04:00

Updater will stop process by ID on mono

This commit is contained in:
Mark McDowall
2014-05-24 12:06:32 -07:00
parent 198e7cc2f7
commit fe8555d3ea
6 changed files with 72 additions and 20 deletions
@@ -21,6 +21,7 @@ namespace NzbDrone.Common.Processes
void SetPriority(int processId, ProcessPriorityClass priority);
void KillAll(string processName);
void Kill(int processId);
Boolean Exists(int processId);
Boolean Exists(string processName);
ProcessPriorityClass GetCurrentProcessPriority();
Process Start(string path, string args = null, Action<string> onOutputDataReceived = null, Action<string> onErrorDataReceived = null);
@@ -40,6 +41,11 @@ namespace NzbDrone.Common.Processes
return ConvertToProcessInfo(Process.GetCurrentProcess());
}
public bool Exists(int processId)
{
return GetProcessById(processId) != null;
}
public Boolean Exists(string processName)
{
return GetProcessesByName(processName).Any();