Merge pull request #174 from fukusuket/fix-500-erro-when-invalid-lacus-url

fix: [crawler] add exception handing for `ping_lacus`
This commit is contained in:
Thirion Aurélien 2023-07-10 10:05:20 +02:00 committed by GitHub
commit 8f0e7f1434
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1795,7 +1795,11 @@ def ping_lacus():
ping = False ping = False
req_error = {'error': 'Lacus URL undefined', 'status_code': 400} req_error = {'error': 'Lacus URL undefined', 'status_code': 400}
else: else:
ping = lacus.is_up try:
ping = lacus.is_up
except:
req_error = {'error': 'Failed to connect Lacus URL', 'status_code': 400}
ping = False
update_lacus_connection_status(ping, req_error=req_error) update_lacus_connection_status(ping, req_error=req_error)
return ping return ping