mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 12:45:19 +00:00
prepare config for healthchecks integration
This commit is contained in:
parent
4558cf9e6f
commit
c01ab8303c
8 changed files with 89 additions and 34 deletions
|
|
@ -49,11 +49,6 @@ async def async_main():
|
|||
|
||||
logging.basicConfig(level=config.log_level)
|
||||
|
||||
tg_client = await sender.get_client()
|
||||
|
||||
cvars.tg_client.set(tg_client)
|
||||
my_username = (await tg_client.get_me()).username
|
||||
logging.info(f"Logged in as @{my_username}")
|
||||
check_sets = config_enums.CheckSet
|
||||
|
||||
checker_sets: dict[config_enums.CheckSet, list[Coroutine | BaseChecker]] = {
|
||||
|
|
@ -94,8 +89,18 @@ async def async_main():
|
|||
|
||||
checker_sets[check_sets.REMIND][0].check_args = [checkers]
|
||||
|
||||
command_manager = CommandHandlerManager(checkers)
|
||||
await command_manager.attach_handlers(tg_client)
|
||||
if config.alert_channels.telegram is not None:
|
||||
tg_client = await sender.get_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)
|
||||
else:
|
||||
logging.info("Telegram integration is disabled")
|
||||
tg_client = None
|
||||
|
||||
cvars.tg_client.set(tg_client)
|
||||
|
||||
signal.signal(signal.SIGTERM, stop_gracefully)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue