mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
simplify CaptureAsync()
This commit is contained in:
parent
71d835f82f
commit
676f7807d8
1 changed files with 1 additions and 11 deletions
|
|
@ -14,7 +14,6 @@ namespace FilterLists.Services.Snapshot
|
|||
public class SnapshotService : Service
|
||||
{
|
||||
private readonly BatchSizeService batchSizeService;
|
||||
private readonly DateTime yesterday = DateTime.UtcNow.AddDays(-1);
|
||||
private string uaString;
|
||||
|
||||
public SnapshotService(FilterListsDbContext dbContext, IConfigurationProvider mapConfig,
|
||||
|
|
@ -35,17 +34,8 @@ await DbContext
|
|||
.FilterLists
|
||||
.Where(l => !l.CantSnapshot &&
|
||||
!(l.ViewUrl.StartsWith(WaybackService.WaybackMachineUrlPrefix) &&
|
||||
l.Snapshots.Any(s => s.WasSuccessful)) &&
|
||||
(!l.Snapshots.Any() ||
|
||||
l.Snapshots
|
||||
.Select(s => s.CreatedDateUtc)
|
||||
.OrderByDescending(d => d)
|
||||
.First() < yesterday))
|
||||
l.Snapshots.Any(s => s.WasSuccessful)))
|
||||
.OrderBy(l => l.Snapshots.Any())
|
||||
.ThenBy(l => l.Snapshots
|
||||
.OrderByDescending(s => s.CreatedDateUtc)
|
||||
.FirstOrDefault()
|
||||
.WasSuccessful)
|
||||
.ThenBy(l => l.Snapshots
|
||||
.Select(s => s.CreatedDateUtc)
|
||||
.OrderByDescending(d => d)
|
||||
|
|
|
|||
Loading…
Reference in a new issue