diff --git a/src/FilterLists.Services/Snapshot/SnapshotDe.cs b/src/FilterLists.Services/Snapshot/SnapshotDe.cs index 95ee4ace2..740561e5a 100644 --- a/src/FilterLists.Services/Snapshot/SnapshotDe.cs +++ b/src/FilterLists.Services/Snapshot/SnapshotDe.cs @@ -52,7 +52,7 @@ public async Task TrySaveAsync() private async Task Add() { - await dbContext.Snapshots.AddAsync(snapshot); + dbContext.Snapshots.Add(snapshot); await dbContext.SaveChangesAsync(); } diff --git a/src/FilterLists.Services/Snapshot/SnapshotDeBatch.cs b/src/FilterLists.Services/Snapshot/SnapshotDeBatch.cs index 7422d3cd4..bbdc11962 100644 --- a/src/FilterLists.Services/Snapshot/SnapshotDeBatch.cs +++ b/src/FilterLists.Services/Snapshot/SnapshotDeBatch.cs @@ -25,17 +25,17 @@ public SnapshotDeBatch(FilterListsDbContext dbContext, Data.Entities.Snapshot sn public async Task SaveAsync() { - await AddRules(); + AddRules(); AddSnapshotRules(); await dbContext.SaveChangesAsync(); } - private async Task AddRules() + private void AddRules() { var existingRules = GetExistingRules(); var newRules = CreateNewRules(existingRules); rules = existingRules.Concat(newRules); - await dbContext.Rules.AddRangeAsync(newRules); + dbContext.Rules.AddRange(newRules); } private IQueryable GetExistingRules() => dbContext.Rules.Where(r => rawRules.Contains(r.Raw));