Fix warning aggregation and crashes on timeouts

This commit is contained in:
PapaTutuWawa 2021-01-07 17:18:41 +01:00
parent 2c1fb0d092
commit b2c3967aeb

View File

@ -299,8 +299,12 @@ help - Gebe diese Hilfe aus'''
self._warnings1 = self._warnings0 self._warnings1 = self._warnings0
self._warnings0 = [] self._warnings0 = []
for source in self._sources: for source in self._sources:
try:
req = requests.get(source) req = requests.get(source)
self._warnings0 = parse_data(req.text) 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 # Find new warnings and send the new ones
ids = map(lambda x: x.id, self._warnings1) ids = map(lambda x: x.id, self._warnings1)