mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
fix bug in GetLeastRecentlyCapturedLists()
This commit is contained in:
parent
72a1368b7f
commit
2ca04fc68f
1 changed files with 9 additions and 9 deletions
|
|
@ -34,16 +34,16 @@ private void RollbackIncomplete()
|
|||
|
||||
private async Task<IEnumerable<FilterListViewUrlDto>> GetLeastRecentlyCapturedLists(int batchSize)
|
||||
{
|
||||
return await dbContext.FilterLists
|
||||
.OrderBy(x => x.Snapshots.Any())
|
||||
.ThenBy(x => x.Snapshots
|
||||
.Select(y => y.CreatedDateUtc)
|
||||
.OrderByDescending(y => y)
|
||||
.FirstOrDefault())
|
||||
.Where(x => x.Snapshots
|
||||
.Select(y => y.CreatedDateUtc)
|
||||
return await dbContext.FilterLists.OrderBy(x => x.Snapshots.Any())
|
||||
.ThenBy(x =>
|
||||
x.Snapshots.Select(y => y.CreatedDateUtc)
|
||||
.OrderByDescending(y => y)
|
||||
.FirstOrDefault())
|
||||
.Where(x => !x.Snapshots.Any() ||
|
||||
x.Snapshots.Select(y => y.CreatedDateUtc)
|
||||
.OrderByDescending(y => y)
|
||||
.FirstOrDefault() < DateTime.UtcNow.AddDays(-1))
|
||||
.FirstOrDefault() <
|
||||
DateTime.UtcNow.AddDays(-1))
|
||||
.Take(batchSize)
|
||||
.AsNoTracking()
|
||||
.ProjectTo<FilterListViewUrlDto>()
|
||||
|
|
|
|||
Loading…
Reference in a new issue