mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
cleaned up some code around process handling.
This commit is contained in:
parent
e24c85cc1c
commit
f9fe119af2
6 changed files with 55 additions and 47 deletions
|
@ -30,17 +30,9 @@ namespace NzbDrone
|
|||
{
|
||||
try
|
||||
{
|
||||
var currentProcess = _processProvider.GetCurrentProcess();
|
||||
if (currentProcess.Priority != ProcessPriorityClass.Normal)
|
||||
if (_processProvider.GetCurrentProcessPriority() != ProcessPriorityClass.Normal)
|
||||
{
|
||||
_processProvider.SetPriority(currentProcess.Id, ProcessPriorityClass.Normal);
|
||||
}
|
||||
|
||||
var iisProcess = _processProvider.GetProcessById(_processProvider.GetCurrentProcess().Id);
|
||||
if (iisProcess != null && iisProcess.Priority != ProcessPriorityClass.Normal &&
|
||||
iisProcess.Priority != ProcessPriorityClass.AboveNormal)
|
||||
{
|
||||
_processProvider.SetPriority(iisProcess.Id, ProcessPriorityClass.Normal);
|
||||
_processProvider.SetPriority(_processProvider.GetCurrentProcess().Id, ProcessPriorityClass.Normal);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue