diff --git a/src/FilterLists.Services/Snapshot/SnapshotService.cs b/src/FilterLists.Services/Snapshot/SnapshotService.cs index 539b1f971..2cf91339f 100644 --- a/src/FilterLists.Services/Snapshot/SnapshotService.cs +++ b/src/FilterLists.Services/Snapshot/SnapshotService.cs @@ -39,7 +39,11 @@ private async Task CleanupFailedSnapshots() private async Task> GetListsToCapture(int batchSize) => await DbContext .FilterLists - .Where(l => !(l.ViewUrl.StartsWith(WaybackService.WaybackMachineUrlPrefix) && + .Where(l => l.Snapshots + .OrderByDescending(s => s.CreatedDateUtc) + .Select(s => s.CreatedDateUtc) + .FirstOrDefault() <= DateTime.Now.AddDays(-7) && + !(l.ViewUrl.StartsWith(WaybackService.WaybackMachineUrlPrefix) && l.Snapshots.Any(s => s.WasSuccessful))) .OrderBy(l => l.Snapshots.Any()) .ThenBy(l => l.Snapshots