From 057e248f8f6578752fa5b0d4f420747ebea6f65f Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Thu, 10 May 2012 17:04:44 -0700 Subject: [PATCH] Fixed: Re-enabled monitoring provider. --- NzbDrone/ProcessAttacher.cs | 5 +++-- NzbDrone/Providers/MonitoringProvider.cs | 14 ++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/NzbDrone/ProcessAttacher.cs b/NzbDrone/ProcessAttacher.cs index 05d318cf9..c673ac85b 100644 --- a/NzbDrone/ProcessAttacher.cs +++ b/NzbDrone/ProcessAttacher.cs @@ -7,14 +7,15 @@ #if DEBUG using System; using System.Collections.Generic; +using System.Diagnostics; using System.Runtime.InteropServices; -using EnvDTE; using EnvDTE80; +using Process = EnvDTE.Process; using Thread = System.Threading.Thread; namespace NzbDrone { - //[DebuggerStepThrough] + [DebuggerStepThrough] public class ProcessAttacher { public static void Attach() diff --git a/NzbDrone/Providers/MonitoringProvider.cs b/NzbDrone/Providers/MonitoringProvider.cs index 2a5968c33..e2b4c297d 100644 --- a/NzbDrone/Providers/MonitoringProvider.cs +++ b/NzbDrone/Providers/MonitoringProvider.cs @@ -82,13 +82,7 @@ namespace NzbDrone.Providers try { - ICredentials identity = null; - - if (_configFileProvider.AuthenticationType == AuthenticationType.Windows) - { - identity = CredentialCache.DefaultCredentials; - } - + ICredentials identity = CredentialCache.DefaultCredentials; _httpProvider.DownloadString(_iisProvider.AppUrl, identity); //This should preload the home page, making the first load faster. string response = _httpProvider.DownloadString(_iisProvider.AppUrl + "/health", identity); @@ -107,11 +101,11 @@ namespace NzbDrone.Providers catch (Exception ex) { _pingFailCounter++; - logger.ErrorException("Application pool is not responding. Count " + _pingFailCounter, ex); - if (_pingFailCounter > 4) + logger.Error("Application pool is not responding. Count " + _pingFailCounter + ex.Message); + if (_pingFailCounter > 10) { _pingFailCounter = 0; - //_iisProvider.RestartServer(); + _iisProvider.RestartServer(); } } }