don't keep retrying snapshots of failed lists

This commit is contained in:
Collin M. Barrett 2018-09-29 12:43:03 -05:00
parent 61cb73a66a
commit 44a2dd2e95

View file

@ -13,12 +13,6 @@ namespace FilterLists.Services.Snapshot
{
public class SnapshotService : Service
{
private readonly Expression<Func<Data.Entities.FilterList, bool>> ifLastSnapFailed =
l => l.Snapshots
.OrderByDescending(s => s.CreatedDateUtc)
.Select(s => s.WasUpdated && !s.WasSuccessful)
.FirstOrDefault();
private readonly Expression<Func<Data.Entities.FilterList, DateTime?>> lastSnapTimestamp =
l => l.Snapshots
.Select(s => s.CreatedDateUtc)
@ -55,7 +49,6 @@ private async Task<IEnumerable<FilterListViewUrlDto>> GetListsToCapture(int batc
await DbContext
.FilterLists
.OrderBy(l => l.Snapshots.Any())
.ThenByDescending(ifLastSnapFailed)
.ThenBy(lastSnapTimestamp)
.Take(batchSize)
.ProjectTo<FilterListViewUrlDto>(MapConfig)