The Free Software Media System - Server Backend & API
Use ExecuteDelete for cleaning activity logs
Patrick Barronc9c133bc4323
diff --git a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs b/Jellyfin.Server.Implementations/Activity/ActivityManager.csindex a2ea6b2251..54272aeafa 100644--- a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs+++ b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs@@ -79,11 +79,10 @@ namespace Jellyfin.Server.Implementations.Activityvar dbContext = await _provider.CreateDbContextAsync().ConfigureAwait(false);await using (dbContext.ConfigureAwait(false)){- var entries = dbContext.ActivityLogs- .Where(entry => entry.DateCreated <= startDate);-- dbContext.RemoveRange(entries);- await dbContext.SaveChangesAsync().ConfigureAwait(false);+ await dbContext.ActivityLogs+ .Where(entry => entry.DateCreated <= startDate)+ .ExecuteDeleteAsync()+ .ConfigureAwait(false);}}