diff options
| author | Vasily <just.one.man@yandex.ru> | 2020-03-05 20:09:33 +0300 |
|---|---|---|
| committer | Vasily <just.one.man@yandex.ru> | 2020-03-05 20:09:33 +0300 |
| commit | ecaa7f8014666a474c87481471ce7cda7006165a (patch) | |
| tree | 71d245a22dec4988029c57db403f8fcd3b5df2b6 /Jellyfin.Server/Program.cs | |
| parent | 66e11879efcd2a77476ca9704fa938e89776956c (diff) | |
Improve migration logic
Diffstat (limited to 'Jellyfin.Server/Program.cs')
| -rw-r--r-- | Jellyfin.Server/Program.cs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index aa1bdb169..027186105 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -38,6 +38,11 @@ namespace Jellyfin.Server /// </summary> public static class Program { + /// <summary> + /// The name of logging configuration file. + /// </summary> + public static readonly string LoggingConfigFile = "logging.json"; + private static readonly CancellationTokenSource _tokenSource = new CancellationTokenSource(); private static readonly ILoggerFactory _loggerFactory = new SerilogLoggerFactory(); private static ILogger _logger = NullLogger.Instance; @@ -182,7 +187,7 @@ namespace Jellyfin.Server // A bit hacky to re-use service provider since ASP.NET doesn't allow a custom service collection. appHost.ServiceProvider = host.Services; appHost.FindParts(); - appHost.TryMigrate(); + Migrations.MigrationRunner.Run(appHost, _loggerFactory); try { @@ -438,7 +443,7 @@ namespace Jellyfin.Server private static async Task<IConfiguration> CreateConfiguration(IApplicationPaths appPaths) { const string ResourcePath = "Jellyfin.Server.Resources.Configuration.logging.json"; - string configPath = Path.Combine(appPaths.ConfigurationDirectoryPath, "logging.json"); + string configPath = Path.Combine(appPaths.ConfigurationDirectoryPath, LoggingConfigFile); if (!File.Exists(configPath)) { @@ -460,7 +465,7 @@ namespace Jellyfin.Server return new ConfigurationBuilder() .SetBasePath(appPaths.ConfigurationDirectoryPath) .AddInMemoryCollection(ConfigurationOptions.Configuration) - .AddJsonFile("logging.json", false, true) + .AddJsonFile(LoggingConfigFile, false, true) .AddEnvironmentVariables("JELLYFIN_") .Build(); } |
