mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 14:08:44 -04:00
Throw exception on migration failure to halt application
Also save migration configuration after each migration instead of at the end in case an exception is thrown part way through the list
This commit is contained in:
parent
ae9948ce04
commit
a0fdceb4bc
1 changed files with 2 additions and 6 deletions
|
@ -59,16 +59,12 @@ namespace Jellyfin.Server.Migrations
|
|||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, "Could not apply migration {Name}", migrationRoutine.Name);
|
||||
continue;
|
||||
throw;
|
||||
}
|
||||
|
||||
// Mark the migration as completed
|
||||
logger.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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue