mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2026-10-28 10:48:49 -04:00
fixed cycle prune deleting current seeker cycle
This commit is contained in:
1 parent
36e49d7ef4
commit
07bbed8d91
2 files changed
+54
-7
No files matched your search
@@ -223,6 +223,8 @@ public class EventCleanupService : BackgroundService
|
||||
DateTimeOffset cutoff = _timeProvider.GetUtcNow().AddDays(-retentionDays);
|
||||
int deleted = await eventsContext.SeekerCycles
|
||||
.Where(c => c.CompletedAt != null && c.CompletedAt < cutoff)
|
||||
.Where(c => eventsContext.SeekerCycles.Any(o =>
|
||||
o.ArrInstanceId == c.ArrInstanceId && o.IsDryRun == c.IsDryRun && o.StartedAt > c.StartedAt))
|
||||
.ExecuteDeleteAsync();
|
||||
|
||||
if (deleted > 0)
|
||||
|
||||
Reference in new issue
Block a user