mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 12:45:19 +00:00
add healthchecks client
This commit is contained in:
parent
c01ab8303c
commit
d59d5ac4e2
11 changed files with 630 additions and 5 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue