revert cleanup orphaned rules (snap perf hit)

This commit is contained in:
Collin M. Barrett 2018-09-29 13:26:52 -05:00
parent 514a03e9cf
commit b9fdb66138

View file

@ -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<IEnumerable<FilterListViewUrlDto>> GetListsToCapture(int batchSize) =>
await DbContext