diff --git a/NzbDrone.App.Test/MonitoringProviderTest.cs b/NzbDrone.App.Test/MonitoringProviderTest.cs index 5e23e898d..615d4101f 100644 --- a/NzbDrone.App.Test/MonitoringProviderTest.cs +++ b/NzbDrone.App.Test/MonitoringProviderTest.cs @@ -1,4 +1,5 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; using System.Linq; using FizzWare.NBuilder; @@ -8,7 +9,6 @@ using NzbDrone.Common; using NzbDrone.Common.Model; using NzbDrone.Providers; using NzbDrone.Test.Common; -using NzbDrone.Test.Common.AutoMoq; namespace NzbDrone.App.Test { @@ -19,17 +19,21 @@ namespace NzbDrone.App.Test [Test] public void Ensure_priority_doesnt_fail_on_invalid_iis_proccess_id() { - var processMock = Mocker.GetMock(); - processMock.Setup(c => c.GetCurrentProcess()) + Mocker.GetMock().Setup(c => c.GetCurrentProcess()) .Returns(Builder.CreateNew().With(c => c.Priority == ProcessPriorityClass.Normal).Build()); - processMock.Setup(c => c.GetProcessById(It.IsAny())).Returns((ProcessInfo)null); + Mocker.GetMock().Setup(c => c.GetProcessById(It.IsAny())).Returns((ProcessInfo)null); - var subject = Mocker.Resolve(); + Mocker.Resolve().EnsurePriority(null); + } + [Test] + public void Ensure_should_log_warn_exception_rather_than_throw() + { + Mocker.GetMock().Setup(c => c.GetCurrentProcess()).Throws(); + Mocker.Resolve().EnsurePriority(null); - //Act - subject.EnsurePriority(null); + ExceptionVerification.ExpectedWarns(1); } diff --git a/NzbDrone.App.Test/NzbDrone.App.Test.csproj b/NzbDrone.App.Test/NzbDrone.App.Test.csproj index 136fe17a6..fa5e7c237 100644 --- a/NzbDrone.App.Test/NzbDrone.App.Test.csproj +++ b/NzbDrone.App.Test/NzbDrone.App.Test.csproj @@ -46,6 +46,9 @@ ..\packages\Ninject.2.2.1.4\lib\net40-Full\Ninject.dll + + ..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll + False ..\packages\NUnit.2.6.0.12054\lib\nunit.framework.dll diff --git a/NzbDrone.App.Test/packages.config b/NzbDrone.App.Test/packages.config index 0cc98eebb..fc23577cf 100644 --- a/NzbDrone.App.Test/packages.config +++ b/NzbDrone.App.Test/packages.config @@ -4,5 +4,6 @@ + \ No newline at end of file diff --git a/NzbDrone.Web/Content/DataTables-1.9.0/media/images/Sorting icons.psd b/NzbDrone.Web/Content/DataTables-1.9.0/media/images/Sorting icons.psd deleted file mode 100644 index 53b2e0685..000000000 Binary files a/NzbDrone.Web/Content/DataTables-1.9.0/media/images/Sorting icons.psd and /dev/null differ diff --git a/NzbDrone.Web/Content/DataTables-1.9.0/media/images/favicon.ico b/NzbDrone.Web/Content/DataTables-1.9.0/media/images/favicon.ico deleted file mode 100644 index 6eeaa2a0d..000000000 Binary files a/NzbDrone.Web/Content/DataTables-1.9.0/media/images/favicon.ico and /dev/null differ diff --git a/NzbDrone/Providers/MonitoringProvider.cs b/NzbDrone/Providers/MonitoringProvider.cs index 9a838cdf0..895d2fac8 100644 --- a/NzbDrone/Providers/MonitoringProvider.cs +++ b/NzbDrone/Providers/MonitoringProvider.cs @@ -44,7 +44,7 @@ namespace NzbDrone.Providers AppDomain.CurrentDomain.ProcessExit += ProgramExited; AppDomain.CurrentDomain.DomainUnload += ProgramExited; - + _processPriorityCheckTimer = new Timer(EnsurePriority); _processPriorityCheckTimer.Change(TimeSpan.FromSeconds(15), TimeSpan.FromMinutes(30)); @@ -55,17 +55,24 @@ namespace NzbDrone.Providers public virtual void EnsurePriority(object sender) { - var currentProcess = _processProvider.GetCurrentProcess(); - if (currentProcess.Priority != ProcessPriorityClass.Normal) + try { - _processProvider.SetPriority(currentProcess.Id, ProcessPriorityClass.Normal); - } + var currentProcess = _processProvider.GetCurrentProcess(); + if (currentProcess.Priority != ProcessPriorityClass.Normal) + { + _processProvider.SetPriority(currentProcess.Id, ProcessPriorityClass.Normal); + } - var iisProcess = _processProvider.GetProcessById(_iisProvider.IISProcessId); - if (iisProcess != null && iisProcess.Priority != ProcessPriorityClass.Normal && - iisProcess.Priority != ProcessPriorityClass.AboveNormal) + var iisProcess = _processProvider.GetProcessById(_iisProvider.IISProcessId); + if (iisProcess != null && iisProcess.Priority != ProcessPriorityClass.Normal && + iisProcess.Priority != ProcessPriorityClass.AboveNormal) + { + _processProvider.SetPriority(iisProcess.Id, ProcessPriorityClass.Normal); + } + } + catch (Exception e) { - _processProvider.SetPriority(iisProcess.Id, ProcessPriorityClass.Normal); + logger.WarnException("Unable to verify priority", e); } }