Use ExecuteDelete for cleaning activity logs
This commit is contained in:
parent
6b940e141e
commit
c9c133bc43
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user