From c1907354e889011175446439a34b21d4ad260964 Mon Sep 17 00:00:00 2001 From: Cody Robibero Date: Sun, 12 May 2024 09:14:36 -0600 Subject: [PATCH] Add metrics collector to disposable parts (#11539) --- Emby.Server.Implementations/ApplicationHost.cs | 2 +- Jellyfin.Server/Program.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs index 6add7e0b39..c394b25bd5 100644 --- a/Emby.Server.Implementations/ApplicationHost.cs +++ b/Emby.Server.Implementations/ApplicationHost.cs @@ -422,7 +422,7 @@ namespace Emby.Server.Implementations // Initialize runtime stat collection if (ConfigurationManager.Configuration.EnableMetrics) { - DotNetRuntimeStatsBuilder.Default().StartCollecting(); + _disposableParts.Add(DotNetRuntimeStatsBuilder.Default().StartCollecting()); } var networkConfiguration = ConfigurationManager.GetNetworkConfiguration(); diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs index fd76969062..295fb8112f 100644 --- a/Jellyfin.Server/Program.cs +++ b/Jellyfin.Server/Program.cs @@ -185,6 +185,7 @@ namespace Jellyfin.Server } catch (Exception ex) { + _restartOnShutdown = false; _logger.LogCritical(ex, "Error while starting server"); } finally