add healthchecks client

This commit is contained in:
Alex Tau 2025-08-15 02:56:27 +03:00
parent c01ab8303c
commit d59d5ac4e2
11 changed files with 630 additions and 5 deletions

View file

@ -90,17 +90,24 @@ async def async_main():
checker_sets[check_sets.REMIND][0].check_args = [checkers]
if config.alert_channels.telegram is not None:
tg_client = await sender.get_client()
tg_client = await sender.get_tg_client()
my_username = (await tg_client.get_me()).username
logging.info(f"Logged in as @{my_username}")
command_manager = CommandHandlerManager(checkers)
await command_manager.attach_handlers(tg_client)
cvars.tg_client.set(tg_client)
else:
logging.info("Telegram integration is disabled")
tg_client = None
cvars.tg_client.set(tg_client)
if config.alert_channels.healthchecks is not None:
healthchecks_client = sender.get_healthchecks_client()
logging.info("Ready to send pings to healthchecks")
cvars.healthchecks_client.set(healthchecks_client)
else:
healthchecks_client = None
logging.info("Healthchecks integration is disabled")
signal.signal(signal.SIGTERM, stop_gracefully)