Refactor tracker update

This commit is contained in:
relikd
2020-09-21 14:30:12 +02:00
parent fd821d6743
commit 09917ba1ee
3 changed files with 33 additions and 37 deletions

View File

@@ -97,6 +97,17 @@ def enrich_with_bundle_ids(index):
index[key][dom] = [index['bundle'][i] for i in ids]
def all_bundles_containing(list_of_domains):
affected = set()
json = load_json_from_disk(fname_all())
haystack = sorted([x[::-1] for x in list_of_domains])
for key in ['pardom', 'subdom']:
for dom, ids in json[key].items():
if mylib.bintree_lookup(haystack, dom[::-1]):
affected.update(ids)
return [json['bundle'][i] for i in affected]
def process(bundle_ids, deleteOnly=False):
print('writing index: domains ...')
fname = fname_all()