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);
|
var dbContext = await _provider.CreateDbContextAsync().ConfigureAwait(false);
|
||||||
await using (dbContext.ConfigureAwait(false))
|
await using (dbContext.ConfigureAwait(false))
|
||||||
{
|
{
|
||||||
var entries = dbContext.ActivityLogs
|
await dbContext.ActivityLogs
|
||||||
.Where(entry => entry.DateCreated <= startDate);
|
.Where(entry => entry.DateCreated <= startDate)
|
||||||
|
.ExecuteDeleteAsync()
|
||||||
dbContext.RemoveRange(entries);
|
.ConfigureAwait(false);
|
||||||
await dbContext.SaveChangesAsync().ConfigureAwait(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user