mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
adding rules shouldn't be async
This commit is contained in:
parent
da24b04804
commit
92c004a60a
1 changed files with 6 additions and 5 deletions
|
|
@ -24,7 +24,7 @@ public async Task ScrapeAsync(int batchSize)
|
|||
{
|
||||
var lists = await GetNextFilterListDtosToScrape(batchSize);
|
||||
var snapshots = await GetSnapshots(lists);
|
||||
await AddOrUpdateRules(snapshots);
|
||||
AddOrUpdateRules(snapshots);
|
||||
}
|
||||
|
||||
private async Task<IEnumerable<FilterListDto>> GetNextFilterListDtosToScrape(int batchSize)
|
||||
|
|
@ -60,13 +60,14 @@ private static async Task<string> GetContent(string url)
|
|||
return null;
|
||||
}
|
||||
|
||||
private async Task AddOrUpdateRules(IEnumerable<Snapshot> snapshots)
|
||||
private void AddOrUpdateRules(IEnumerable<Snapshot> snapshots)
|
||||
{
|
||||
await Task.WhenAll(snapshots.Select(async snapshot => await AddOrUpdateRules(snapshot)));
|
||||
foreach (var snapshot in snapshots)
|
||||
AddOrUpdateRules(snapshot);
|
||||
}
|
||||
|
||||
//TODO: finish and validate
|
||||
private async Task AddOrUpdateRules(Snapshot snapshot)
|
||||
private void AddOrUpdateRules(Snapshot snapshot)
|
||||
{
|
||||
// add new Rules
|
||||
var snapshotRulesRaw =
|
||||
|
|
@ -97,7 +98,7 @@ private async Task AddOrUpdateRules(Snapshot snapshot)
|
|||
|
||||
//TODO: update FilterList.ScrapedDateUtc
|
||||
|
||||
await filterListsDbContext.SaveChangesAsync();
|
||||
filterListsDbContext.SaveChangesAsync();
|
||||
}
|
||||
|
||||
private class FilterListDto
|
||||
|
|
|
|||
Loading…
Reference in a new issue