The Free Software Media System - Server Backend & API
Throw exception on migration failure to halt application
Mark Monteiroa0fdceb4bcf6
diff --git a/Jellyfin.Server/Migrations/MigrationRunner.cs b/Jellyfin.Server/Migrations/MigrationRunner.csindex 8bc29d8ac8..0f9c2a3914 100644--- a/Jellyfin.Server/Migrations/MigrationRunner.cs+++ b/Jellyfin.Server/Migrations/MigrationRunner.cs@@ -59,16 +59,12 @@ namespace Jellyfin.Server.Migrationscatch (Exception ex){logger.LogError(ex, "Could not apply migration {Name}", migrationRoutine.Name);- continue;+ throw;}+ // Mark the migration as completedlogger.LogInformation("Migration {Name} applied successfully", migrationRoutine.Name);applied.Add(migrationRoutine.Name);- }-- if (applied.Count > migrationOptions.Applied.Length)- {- logger.LogInformation("Some migrations were run, saving the state");migrationOptions.Applied = applied.ToArray();host.ServerConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions);}