From 557c8457694ae5f54ebb5a8421048d7b3f6f4216 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 18 Dec 2019 21:11:14 +0000 Subject: catch and log errors from healthcheck.py - otherwise it can CRITICAL --- modules/healthcheck.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/healthcheck.py b/modules/healthcheck.py index 0cf2c72b..3b5acfe2 100644 --- a/modules/healthcheck.py +++ b/modules/healthcheck.py @@ -9,4 +9,9 @@ class Module(ModuleManager.BaseModule): @utils.hook("cron") @utils.kwarg("schedule", "*/10") def ten_minutes(self, event): - utils.http.request(self.bot.config["healthcheck-url"]) + url = self.bot.config["healthcheck-url"] + try: + utils.http.request(url) + except Exception as e: + self.log.error("Failed to cal healthcheck-url (%s)", [url], + exc_info=True) -- cgit v1.3.1-10-gc9f91