From 815ef345fb2e5791fb04f4e562fcd4528099cf27 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Wed, 22 Aug 2018 18:02:41 -0500 Subject: [PATCH] retry failed snapshots first ...but still no more than once per day ref #369 --- src/FilterLists.Services/Snapshot/SnapshotService.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/FilterLists.Services/Snapshot/SnapshotService.cs b/src/FilterLists.Services/Snapshot/SnapshotService.cs index 85a1c90b3..87f43102b 100644 --- a/src/FilterLists.Services/Snapshot/SnapshotService.cs +++ b/src/FilterLists.Services/Snapshot/SnapshotService.cs @@ -37,6 +37,10 @@ await DbContext .OrderByDescending(d => d) .First() < yesterday)) .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)