From 536b82c02636e25e23104e5e1c06af3ae0bf8f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 4 Jan 2022 15:22:52 +0100 Subject: [PATCH] fix: Avoid exception if the source is created after we try to get the modules --- bin/ranking.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/ranking.py b/bin/ranking.py index c52a125..3094165 100755 --- a/bin/ranking.py +++ b/bin/ranking.py @@ -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'