mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-27 18:17:13 +00:00
36 lines
No EOL
1,016 B
C#
36 lines
No EOL
1,016 B
C#
using System.Reflection;
|
|
using NLog;
|
|
using NzbDrone.Common.Composition;
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
using NzbDrone.Common.Instrumentation;
|
|
using NzbDrone.Common.Security;
|
|
using NzbDrone.Core.Datastore;
|
|
|
|
namespace NzbDrone.Host
|
|
{
|
|
public static class Bootstrap
|
|
{
|
|
public static IContainer Start(StartupArguments args, IUserAlert userAlert)
|
|
{
|
|
var logger = NzbDroneLogger.GetLogger();
|
|
|
|
GlobalExceptionHandlers.Register();
|
|
IgnoreCertErrorPolicy.Register();
|
|
|
|
logger.Info("Starting NzbDrone Console. Version {0}", Assembly.GetExecutingAssembly().GetName().Version);
|
|
|
|
|
|
if (!PlatformValidation.IsValidate(userAlert))
|
|
{
|
|
throw new TerminateApplicationException();
|
|
}
|
|
|
|
var container = MainAppContainerBuilder.BuildContainer(args);
|
|
|
|
DbFactory.RegisterDatabase(container);
|
|
container.Resolve<Router>().Route();
|
|
|
|
return container;
|
|
}
|
|
}
|
|
} |