You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Radarr/src/NzbDrone.Host/Bootstrap.cs

47 lines
1.2 KiB

using System.Reflection;
using NzbDrone.Common.Composition;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Instrumentation;
using NzbDrone.Common.Security;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Host
{
public class Bootstrap
{
public IContainer Container { get; private set; }
public Bootstrap(StartupArguments args, IUserAlert userAlert)
{
var logger = NzbDroneLogger.GetLogger();
GlobalExceptionHandlers.Register();
IgnoreCertErrorPolicy.Register();
logger.Info("Starting NzbDrone Console. Version {0}", Assembly.GetExecutingAssembly().GetName().Version);
12 years ago
if (!PlatformValidation.IsValidate(userAlert))
{
throw new TerminateApplicationException("Missing system requirements");
}
Container = MainAppContainerBuilder.BuildContainer(args);
}
public void Start()
{
DbFactory.RegisterDatabase(Container);
Container.Resolve<Router>().Route();
}
public void EnsureSingleInstance()
{
Container.Resolve<ISingleInstancePolicy>().EnforceSingleInstance();
}
}
}