2019-12-11 15:50:15 +00:00
|
|
|
#--require-config healthcheck-url
|
|
|
|
|
|
|
|
from src import ModuleManager, utils
|
|
|
|
|
2019-12-12 12:13:24 +00:00
|
|
|
# this module was created for use with https://healthchecks.io/
|
|
|
|
# but it can be used for any similar URL-pinging service.
|
|
|
|
|
2019-12-11 15:50:15 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
|
|
|
@utils.hook("cron")
|
|
|
|
@utils.kwarg("schedule", "*/10")
|
|
|
|
def ten_minutes(self, event):
|
2019-12-18 21:11:14 +00:00
|
|
|
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)
|