From b396996af88b19014ff90a440bdee06c147288b8 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Sat, 24 Aug 2024 01:45:13 +0200 Subject: [PATCH] Fix server crash on shutdown due to DB notifications (#31379) Fixes #31365 --- Content.Server/Database/ServerDbPostgres.Notifications.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Server/Database/ServerDbPostgres.Notifications.cs b/Content.Server/Database/ServerDbPostgres.Notifications.cs index fe358923bf..69cf2c7d77 100644 --- a/Content.Server/Database/ServerDbPostgres.Notifications.cs +++ b/Content.Server/Database/ServerDbPostgres.Notifications.cs @@ -97,6 +97,8 @@ public sealed partial class ServerDbPostgres _notifyLog.Error($"Error in notification listener: {e}"); } } + + _notificationConnection.Dispose(); } private void OnNotification(object _, NpgsqlNotificationEventArgs notification) @@ -116,6 +118,5 @@ public sealed partial class ServerDbPostgres return; _notificationConnection.Notification -= OnNotification; - _notificationConnection.Dispose(); } } -- 2.51.2