mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 08:15:28 +03:00
Optimize migrations (#13855)
This commit is contained in:
@@ -98,10 +98,7 @@ public sealed class SqliteDatabaseProvider : IJellyfinDatabaseProvider
|
||||
var key = DateTime.UtcNow.ToString("yyyyMMddhhmmss", CultureInfo.InvariantCulture);
|
||||
var path = Path.Combine(_applicationPaths.DataPath, "jellyfin.db");
|
||||
var backupFile = Path.Combine(_applicationPaths.DataPath, BackupFolderName);
|
||||
if (!Directory.Exists(backupFile))
|
||||
{
|
||||
Directory.CreateDirectory(backupFile);
|
||||
}
|
||||
Directory.CreateDirectory(backupFile);
|
||||
|
||||
backupFile = Path.Combine(backupFile, $"{key}_jellyfin.db");
|
||||
File.Copy(path, backupFile);
|
||||
@@ -118,7 +115,7 @@ public sealed class SqliteDatabaseProvider : IJellyfinDatabaseProvider
|
||||
|
||||
if (!File.Exists(backupFile))
|
||||
{
|
||||
_logger.LogCritical("Tried to restore a backup that does not exist.");
|
||||
_logger.LogCritical("Tried to restore a backup that does not exist: {Key}", key);
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user