1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-13 22:43:35 +01:00
Radarr/NzbDrone.Host/Bootstrap.cs

36 lines
1016 B
C#
Raw Normal View History

using System.Reflection;
2013-03-01 01:50:50 +01:00
using NLog;
using NzbDrone.Common.Composition;
using NzbDrone.Common.EnvironmentInfo;
2013-05-24 05:23:59 +02:00
using NzbDrone.Common.Instrumentation;
using NzbDrone.Common.Security;
2013-06-28 03:03:04 +02:00
using NzbDrone.Core.Datastore;
namespace NzbDrone.Host
{
public static class Bootstrap
{
public static IContainer Start(StartupArguments args, IUserAlert userAlert)
{
2013-08-31 03:42:30 +02:00
var logger = NzbDroneLogger.GetLogger();
GlobalExceptionHandlers.Register();
IgnoreCertErrorPolicy.Register();
logger.Info("Starting NzbDrone Console. Version {0}", Assembly.GetExecutingAssembly().GetName().Version);
2013-03-01 01:50:50 +01:00
if (!PlatformValidation.IsValidate(userAlert))
{
throw new TerminateApplicationException();
}
var container = MainAppContainerBuilder.BuildContainer(args);
DbFactory.RegisterDatabase(container);
container.Resolve<Router>().Route();
return container;
}
}
}