mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
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…
x
Reference in New Issue
Block a user