From 1e88f5bac0bec8b8e1f96036c7684b17447bc8d0 Mon Sep 17 00:00:00 2001 From: RaidMax Date: Sun, 14 May 2023 21:44:28 -0500 Subject: [PATCH] fix issue with alert manager concurrency --- Application/Alerts/AlertManager.cs | 2 +- SharedLibraryCore/BaseController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Application/Alerts/AlertManager.cs b/Application/Alerts/AlertManager.cs index d33d57fff..1dfc7d96a 100644 --- a/Application/Alerts/AlertManager.cs +++ b/Application/Alerts/AlertManager.cs @@ -55,7 +55,7 @@ public class AlertManager : IAlertManager alerts = alerts.Concat(_states[client.ClientId].AsReadOnly()); } - return alerts.OrderByDescending(alert => alert.OccuredAt); + return alerts.OrderByDescending(alert => alert.OccuredAt).ToList(); } finally { diff --git a/SharedLibraryCore/BaseController.cs b/SharedLibraryCore/BaseController.cs index 2085878e5..45b1c7d10 100644 --- a/SharedLibraryCore/BaseController.cs +++ b/SharedLibraryCore/BaseController.cs @@ -178,7 +178,7 @@ namespace SharedLibraryCore ViewBag.ReportCount = Manager.GetServers().Sum(server => server.Reports.Count(report => DateTime.UtcNow - report.ReportedOn <= TimeSpan.FromHours(24))); ViewBag.PermissionsSet = PermissionsSet; - ViewBag.Alerts = AlertManager.RetrieveAlerts(Client).ToList(); + ViewBag.Alerts = AlertManager.RetrieveAlerts(Client); base.OnActionExecuting(context); }