aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Server.Implementations
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2023-11-22 09:35:35 -0500
committerPatrick Barron <barronpm@gmail.com>2023-11-22 09:35:35 -0500
commitc9c133bc43231609a237291ae40ecb57bfc2576d (patch)
tree6dd9d0dcee50362794bb04a4b3bed1b33c578b11 /Jellyfin.Server.Implementations
parent6b940e141e014f5d67caf68dd8dec04bc1d723dc (diff)
Use ExecuteDelete for cleaning activity logs
Diffstat (limited to 'Jellyfin.Server.Implementations')
-rw-r--r--Jellyfin.Server.Implementations/Activity/ActivityManager.cs9
1 files changed, 4 insertions, 5 deletions
diff --git a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs
index a2ea6b225..54272aeaf 100644
--- a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs
+++ b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs
@@ -79,11 +79,10 @@ namespace Jellyfin.Server.Implementations.Activity
var 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);
}
}