From b9fdb66138749f6fbbb5bc5283bd3124fb9c898d Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 29 Sep 2018 13:26:52 -0500 Subject: [PATCH] revert cleanup orphaned rules (snap perf hit) --- .../Snapshot/SnapshotService.cs | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/FilterLists.Services/Snapshot/SnapshotService.cs b/src/FilterLists.Services/Snapshot/SnapshotService.cs index afe128e2d..cd2c9a913 100644 --- a/src/FilterLists.Services/Snapshot/SnapshotService.cs +++ b/src/FilterLists.Services/Snapshot/SnapshotService.cs @@ -36,12 +36,6 @@ public async Task CaptureAsync(int batchSize) } private async Task CleanupFailedSnapshots() - { - await CleanupOrphanedSnapshotsRules(); - await CleanupOrphanedRules(); - } - - private async Task CleanupOrphanedSnapshotsRules() { const string command = @"DELETE snapshots_rules @@ -50,16 +44,6 @@ FROM snapshots_rules WHERE snapshots.WasSuccessful = 0;"; await DbContext.Database.ExecuteSqlCommandAsync(command); } - - private async Task CleanupOrphanedRules() - { - const string command = - @"DELETE rules - FROM rules - LEFT JOIN snapshots_rules ON rules.Id = snapshots_rules.RuleId - WHERE snapshots_rules.RuleId IS NULL;"; - await DbContext.Database.ExecuteSqlCommandAsync(command); - } private async Task> GetListsToCapture(int batchSize) => await DbContext