mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-07 13:32:17 -07:00
Fixed: Register PostgresOptions when running in utility mode
(cherry picked from commit 3a1d848e59dda24b50220700b61db6046505c7a5)
This commit is contained in:
parent
bdcb371718
commit
d03e472ac6
1 changed files with 17 additions and 6 deletions
|
@ -54,6 +54,7 @@ namespace NzbDrone.Host
|
||||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
|
|
||||||
var appMode = GetApplicationMode(startupContext);
|
var appMode = GetApplicationMode(startupContext);
|
||||||
|
var config = GetConfiguration(startupContext);
|
||||||
|
|
||||||
switch (appMode)
|
switch (appMode)
|
||||||
{
|
{
|
||||||
|
@ -82,12 +83,22 @@ namespace NzbDrone.Host
|
||||||
// Utility mode
|
// Utility mode
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
new Container(rules => rules.WithNzbDroneRules())
|
new HostBuilder()
|
||||||
.AutoAddServices(ASSEMBLIES)
|
.UseServiceProviderFactory(new DryIocServiceProviderFactory(new Container(rules => rules.WithNzbDroneRules())))
|
||||||
.AddNzbDroneLogger()
|
.ConfigureContainer<IContainer>(c =>
|
||||||
.AddStartupContext(startupContext)
|
{
|
||||||
.Resolve<UtilityModeRouter>()
|
c.AutoAddServices(Bootstrap.ASSEMBLIES)
|
||||||
.Route(appMode);
|
.AddNzbDroneLogger()
|
||||||
|
.AddDatabase()
|
||||||
|
.AddStartupContext(startupContext)
|
||||||
|
.Resolve<UtilityModeRouter>()
|
||||||
|
.Route(appMode);
|
||||||
|
})
|
||||||
|
.ConfigureServices(services =>
|
||||||
|
{
|
||||||
|
services.Configure<PostgresOptions>(config.GetSection("Lidarr:Postgres"));
|
||||||
|
}).Build();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue