diff --git a/src/FilterLists.Services/Snapshot/SnapshotService.cs b/src/FilterLists.Services/Snapshot/SnapshotService.cs index dea8410c2..e7dc270a9 100644 --- a/src/FilterLists.Services/Snapshot/SnapshotService.cs +++ b/src/FilterLists.Services/Snapshot/SnapshotService.cs @@ -33,6 +33,7 @@ public async Task CaptureAsync(int batchSize) private async Task CleanupFailedSnapshots() { DbContext.RemoveRange(DbContext.SnapshotRules.Where(sr => !sr.Snapshot.WasSuccessful)); + DbContext.RemoveRange(DbContext.Rules.Where(r => !r.SnapshotRules.Any())); await DbContext.SaveChangesAsync(); }