aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server/Program.cs
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2025-02-02 02:32:28 +0000
committerJPVenson <github@jpb.email>2025-02-02 02:32:28 +0000
commitefb402b1d27ca3f3444f7b81553ced804029bb3f (patch)
tree5fef3c6918066a22cc2e8f68e6f5f9dfc2f4cf64 /Jellyfin.Server/Program.cs
parent61b2ad7f496b6e47ed3646636f57d96916ffbf33 (diff)
Fixed shutdown behavior
Diffstat (limited to 'Jellyfin.Server/Program.cs')
-rw-r--r--Jellyfin.Server/Program.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index fd23b7e25..bb93ef138 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -4,6 +4,7 @@ using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
+using System.Threading;
using System.Threading.Tasks;
using CommandLine;
using Emby.Server.Implementations;
@@ -197,8 +198,9 @@ namespace Jellyfin.Server
_logger.LogInformation("Running query planner optimizations in the database... This might take a while");
var databaseProvider = appHost.ServiceProvider.GetRequiredService<IJellyfinDatabaseProvider>();
-
- await databaseProvider.DisposeAsync().ConfigureAwait(false);
+ var shutdownSource = new CancellationTokenSource();
+ shutdownSource.CancelAfter((int)TimeSpan.FromSeconds(60).TotalMicroseconds);
+ await databaseProvider.RunShutdownTask(shutdownSource.Token).ConfigureAwait(false);
}
host?.Dispose();