mirror of
https://github.com/Radarr/Radarr
synced 2025-02-22 06:11:09 +00:00
Fixed: Register PostgresOptions when running in utility mode
This commit is contained in:
parent
f6590e71d2
commit
3a1d848e59
1 changed files with 17 additions and 6 deletions
|
@ -53,6 +53,7 @@ public static void Start(string[] args, Action<IHostBuilder> trayCallback = null
|
|||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
|
||||
var appMode = GetApplicationMode(startupContext);
|
||||
var config = GetConfiguration(startupContext);
|
||||
|
||||
switch (appMode)
|
||||
{
|
||||
|
@ -81,12 +82,22 @@ public static void Start(string[] args, Action<IHostBuilder> trayCallback = null
|
|||
// Utility mode
|
||||
default:
|
||||
{
|
||||
new Container(rules => rules.WithNzbDroneRules())
|
||||
.AutoAddServices(ASSEMBLIES)
|
||||
.AddNzbDroneLogger()
|
||||
.AddStartupContext(startupContext)
|
||||
.Resolve<UtilityModeRouter>()
|
||||
.Route(appMode);
|
||||
new HostBuilder()
|
||||
.UseServiceProviderFactory(new DryIocServiceProviderFactory(new Container(rules => rules.WithNzbDroneRules())))
|
||||
.ConfigureContainer<IContainer>(c =>
|
||||
{
|
||||
c.AutoAddServices(Bootstrap.ASSEMBLIES)
|
||||
.AddNzbDroneLogger()
|
||||
.AddDatabase()
|
||||
.AddStartupContext(startupContext)
|
||||
.Resolve<UtilityModeRouter>()
|
||||
.Route(appMode);
|
||||
})
|
||||
.ConfigureServices(services =>
|
||||
{
|
||||
services.Configure<PostgresOptions>(config.GetSection("Radarr:Postgres"));
|
||||
}).Build();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue