applicationmode cleanup.

This commit is contained in:
kayone
2013-11-25 22:53:36 -08:00
parent c219be8c8d
commit 1e6817220a
28 changed files with 187 additions and 144 deletions

View File

@@ -1,7 +1,5 @@
using System;
using System.Threading;
using NLog;
using NzbDrone.Common;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Instrumentation;
using NzbDrone.Host;
@@ -16,26 +14,9 @@ namespace NzbDrone.Console
{
try
{
var startupArgs = new StartupArguments(args);
var startupArgs = new StartupContext(args);
LogTargets.Register(startupArgs, false, true);
var container = Bootstrap.Start(startupArgs, new ConsoleAlerts());
if (startupArgs.InstallService || startupArgs.UninstallService)
{
return;
}
var serviceFactory = container.Resolve<INzbDroneServiceFactory>();
while (!serviceFactory.IsServiceStopped)
{
Thread.Sleep(1000);
}
}
catch (TerminateApplicationException e)
{
Logger.Info("Application has been terminated. Reason " + e.Reason);
return;
Bootstrap.Start(startupArgs, new ConsoleAlerts());
}
catch (Exception e)
{