From b2c3967aebf2fd31cd628f30c67df7c08fa74d07 Mon Sep 17 00:00:00 2001 From: Alexander PapaTutuWawa Date: Thu, 7 Jan 2021 17:18:41 +0100 Subject: [PATCH] Fix warning aggregation and crashes on timeouts --- janine/janine.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/janine/janine.py b/janine/janine.py index d7c4291..f426ee7 100644 --- a/janine/janine.py +++ b/janine/janine.py @@ -299,8 +299,12 @@ help - Gebe diese Hilfe aus''' self._warnings1 = self._warnings0 self._warnings0 = [] for source in self._sources: - req = requests.get(source) - self._warnings0 = parse_data(req.text) + try: + req = requests.get(source) + self._warnings0 += parse_data(req.text) + except urllib3.exceptions.MaxRetryError: + log.warn('Connection timeout for request to %s', source) + continue # Find new warnings and send the new ones ids = map(lambda x: x.id, self._warnings1)