mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-25 09:18:34 +00:00
Cleaned up some error messages
This commit is contained in:
parent
120758bf02
commit
be2a5ea754
4 changed files with 20 additions and 35 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -104,13 +104,6 @@ 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();
|
||||
}
|
||||
|
||||
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)
|
||||
|
|
|
@ -60,6 +60,7 @@ namespace NzbDrone
|
|||
}
|
||||
|
||||
_iisProvider.StartServer();
|
||||
//Todo: verify that IIS is actually started
|
||||
|
||||
_debuggerProvider.Attach();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue