diff --git a/LibreNMS/service.py b/LibreNMS/service.py index 4c78f9c678..e4cee0d29b 100644 --- a/LibreNMS/service.py +++ b/LibreNMS/service.py @@ -26,6 +26,14 @@ try: except ImportError: pass +try: + from redis.exceptions import ConnectionError as RedisConnectionError +except ImportError: + + class RedisConnectionError(Exception): + pass + + logger = logging.getLogger(__name__) @@ -844,7 +852,7 @@ class Service: getattr(self.config, worker_type).frequency, ) ) - except pymysql.err.Error: + except (pymysql.err.Error, ConnectionResetError, RedisConnectionError): logger.critical( "Unable to log performance statistics - is the database still online?", exc_info=True,