Do not save a reference to the startup config in ApplicationHost

This commit is contained in:
Mark Monteiro
2020-02-28 23:28:15 +01:00
parent a4e5a5ab31
commit 48f8118072
4 changed files with 17 additions and 23 deletions

View File

@@ -103,10 +103,10 @@ namespace Jellyfin.Server
// Create an instance of the application configuration to use for application startup
await InitLoggingConfigFile(appPaths).ConfigureAwait(false);
IConfiguration appConfig = CreateAppConfiguration(appPaths);
IConfiguration startupConfig = CreateAppConfiguration(appPaths);
// Initialize logging framework
InitializeLoggingFramework(appConfig, appPaths);
InitializeLoggingFramework(startupConfig, appPaths);
_logger = _loggerFactory.CreateLogger("Main");
// Log uncaught exceptions to the logging instead of std error
@@ -171,12 +171,11 @@ namespace Jellyfin.Server
options,
new ManagedFileSystem(_loggerFactory.CreateLogger<ManagedFileSystem>(), appPaths),
GetImageEncoder(appPaths),
new NetworkManager(_loggerFactory.CreateLogger<NetworkManager>()),
appConfig);
new NetworkManager(_loggerFactory.CreateLogger<NetworkManager>()));
try
{
ServiceCollection serviceCollection = new ServiceCollection();
await appHost.InitAsync(serviceCollection).ConfigureAwait(false);
await appHost.InitAsync(serviceCollection, startupConfig).ConfigureAwait(false);
var webHost = CreateWebHostBuilder(appHost, serviceCollection, appPaths).Build();