mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
snapshot each list only once per week
This commit is contained in:
parent
264bfe4115
commit
8d4e2d0c4f
1 changed files with 5 additions and 1 deletions
|
|
@ -39,7 +39,11 @@ private async Task CleanupFailedSnapshots()
|
|||
private async Task<IEnumerable<FilterListViewUrlDto>> 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
|
||||
|
|
|
|||
Loading…
Reference in a new issue