mirror of https://github.com/CIRCL/lookyloo
fix: Avoid webinterface to crash if the monitoring in unavailable
parent
8ad2292d68
commit
cae1f98866
|
@ -165,10 +165,13 @@ class Lookyloo():
|
||||||
if monitoring_config['enable']:
|
if monitoring_config['enable']:
|
||||||
self.monitoring = PyLookylooMonitoring(monitoring_config['url'], get_useragent_for_requests())
|
self.monitoring = PyLookylooMonitoring(monitoring_config['url'], get_useragent_for_requests())
|
||||||
if self.monitoring.is_up:
|
if self.monitoring.is_up:
|
||||||
self.monitoring_enabled = True
|
try:
|
||||||
# NOTE: maybe move that somewhere else: we'll need to restart the webserver
|
# NOTE: maybe move that somewhere else: we'll need to restart the webserver
|
||||||
# if we change the settings in the monitoring instance
|
# if we change the settings in the monitoring instance
|
||||||
self.monitoring_settings = self.monitoring.instance_settings()
|
self.monitoring_settings = self.monitoring.instance_settings()
|
||||||
|
self.monitoring_enabled = True
|
||||||
|
except Exception as e:
|
||||||
|
self.logger.critical(f'Unable to initialize the monitoring instance: {e}')
|
||||||
|
|
||||||
self.logger.info('Initializing context...')
|
self.logger.info('Initializing context...')
|
||||||
self.context = Context()
|
self.context = Context()
|
||||||
|
|
Loading…
Reference in New Issue