aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Migrations/Routines/FixDates.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Server/Migrations/Routines/FixDates.cs')
-rw-r--r--Jellyfin.Server/Migrations/Routines/FixDates.cs19
1 files changed, 11 insertions, 8 deletions
diff --git a/Jellyfin.Server/Migrations/Routines/FixDates.cs b/Jellyfin.Server/Migrations/Routines/FixDates.cs
index f112502b9..a5b11b11d 100644
--- a/Jellyfin.Server/Migrations/Routines/FixDates.cs
+++ b/Jellyfin.Server/Migrations/Routines/FixDates.cs
@@ -41,14 +41,17 @@ public class FixDates : IAsyncMigrationRoutine
{
if (!TimeZoneInfo.Local.Equals(TimeZoneInfo.Utc))
{
- using var context = await _dbProvider.CreateDbContextAsync(cancellationToken).ConfigureAwait(false);
- var sw = Stopwatch.StartNew();
-
- await FixBaseItemsAsync(context, sw, cancellationToken).ConfigureAwait(false);
- sw.Reset();
- await FixChaptersAsync(context, sw, cancellationToken).ConfigureAwait(false);
- sw.Reset();
- await FixBaseItemImageInfos(context, sw, cancellationToken).ConfigureAwait(false);
+ var context = await _dbProvider.CreateDbContextAsync(cancellationToken).ConfigureAwait(false);
+ await using (context.ConfigureAwait(false))
+ {
+ var sw = Stopwatch.StartNew();
+
+ await FixBaseItemsAsync(context, sw, cancellationToken).ConfigureAwait(false);
+ sw.Reset();
+ await FixChaptersAsync(context, sw, cancellationToken).ConfigureAwait(false);
+ sw.Reset();
+ await FixBaseItemImageInfos(context, sw, cancellationToken).ConfigureAwait(false);
+ }
}
}