fix: Avoid exception if the source is created after we try to get the modules

pull/17/head
Raphaël Vinot 2022-01-04 15:22:52 +01:00
parent 612cd12058
commit 536b82c026
1 changed files with 3 additions and 0 deletions

View File

@ -34,6 +34,9 @@ class Ranking(AbstractManager):
cached_meta: Dict[str, Dict[str, Any]] = {}
config_files = load_all_modules_configs()
for source in self.storage.smembers(f'{day}|sources'):
if source not in config_files:
# get it again, just in case it is created after we open them
config_files = load_all_modules_configs()
self.logger.info(f'{day} - Ranking source: {source}')
source_aggregation_key_v4 = f'{day}|{source}|asns|v4'
source_aggregation_key_v6 = f'{day}|{source}|asns|v6'