Cleaned up some error messages

This commit is contained in:
Mark McDowall 2013-01-02 21:11:39 -08:00
parent 120758bf02
commit be2a5ea754
4 changed files with 20 additions and 35 deletions

View File

@ -13,23 +13,6 @@ namespace NzbDrone.Common
private readonly ProcessProvider _processProvider;
private readonly EnvironmentProvider _environmentProvider;
public IISProvider(ConfigFileProvider configFileProvider, ProcessProvider processProvider, EnvironmentProvider environmentProvider)
{
_configFileProvider = configFileProvider;
_processProvider = processProvider;
_environmentProvider = environmentProvider;
}
public IISProvider()
{
}
public string AppUrl
{
get { return string.Format("http://localhost:{0}/", _configFileProvider.Port); }
}
public int IISProcessId { get; private set; }
public bool ServerStarted { get; private set; }
@ -74,6 +57,22 @@ namespace NzbDrone.Common
ServerStarted = true;
}
public IISProvider(ConfigFileProvider configFileProvider, ProcessProvider processProvider, EnvironmentProvider environmentProvider)
{
_configFileProvider = configFileProvider;
_processProvider = processProvider;
_environmentProvider = environmentProvider;
}
public IISProvider()
{
}
public string AppUrl
{
get { return string.Format("http://localhost:{0}/", _configFileProvider.Port); }
}
private static void OnErrorDataReceived(object sender, DataReceivedEventArgs e)
{
if (e == null || String.IsNullOrWhiteSpace(e.Data))
@ -82,7 +81,6 @@ namespace NzbDrone.Common
IISLogger.Error(e.Data);
}
public void RestartServer()
{
ServerStarted = false;
@ -91,7 +89,6 @@ namespace NzbDrone.Common
StartServer();
}
public virtual void StopServer()
{
_processProvider.Kill(IISProcessId);
@ -112,7 +109,6 @@ namespace NzbDrone.Common
}
}
private void OnOutputDataReceived(object s, DataReceivedEventArgs e)
{
if (e == null || String.IsNullOrWhiteSpace(e.Data) || e.Data.StartsWith("Request started:") ||
@ -121,6 +117,5 @@ namespace NzbDrone.Common
Console.WriteLine(e.Data);
}
}
}

View File

@ -103,14 +103,7 @@ namespace NzbDrone.Core
ContainerBuilder.RegisterAssemblyTypes(typeof(CentralDispatch).Assembly)
.Where(t => t.BaseType == typeof(ExternalNotificationBase))
.As<ExternalNotificationBase>();
//ContainerBuilder.RegisterType<Xbmc>().As<ExternalNotificationBase>().SingleInstance();
//ContainerBuilder.RegisterType<Smtp>().As<ExternalNotificationBase>().SingleInstance();
//ContainerBuilder.RegisterType<Twitter>().As<ExternalNotificationBase>().SingleInstance();
//ContainerBuilder.RegisterType<Providers.ExternalNotification.Growl>().As<ExternalNotificationBase>().SingleInstance();
//ContainerBuilder.RegisterType<Prowl>().As<ExternalNotificationBase>().SingleInstance();
//ContainerBuilder.RegisterType<Plex>().As<ExternalNotificationBase>().SingleInstance();
.As<ExternalNotificationBase>();
}
private void RegisterMetadataProviders()
@ -120,8 +113,6 @@ namespace NzbDrone.Core
ContainerBuilder.RegisterAssemblyTypes(typeof(CentralDispatch).Assembly)
.Where(t => t.IsSubclassOf(typeof(MetadataBase)))
.As<MetadataBase>();
//ContainerBuilder.RegisterType<Providers.Metadata.Xbmc>().As<MetadataBase>().SingleInstance();
}
private void RegisterReporting(IContainer container)

View File

@ -60,6 +60,7 @@ namespace NzbDrone
}
_iisProvider.StartServer();
//Todo: verify that IIS is actually started
_debuggerProvider.Attach();

View File

@ -49,7 +49,6 @@ namespace NzbDrone.Providers
_pingTimer.Change(TimeSpan.FromSeconds(5), TimeSpan.FromMinutes(1));
}
public virtual void EnsurePriority(object sender)
{
try
@ -98,8 +97,8 @@ namespace NzbDrone.Providers
catch (Exception ex)
{
_pingFailCounter++;
logger.Error("Application pool is not responding. Count " + _pingFailCounter + ex.Message);
if (_pingFailCounter > 10)
logger.Error("Application pool is not responding. Count: {0} - {1}", _pingFailCounter, ex.Message);
if (_pingFailCounter >= 10)
{
_pingFailCounter = 0;
_iisProvider.RestartServer();
@ -112,7 +111,6 @@ namespace NzbDrone.Providers
_iisProvider.StopServer();
}
public static void AppDomainException(Exception excepion)
{
Console.WriteLine("EPIC FAIL: {0}", excepion);