Suppress watchdog notifications on startup

This commit is contained in:
2026-02-07 23:45:14 +03:00
parent f66d4a482d
commit 7d744f5cf4

View File

@@ -101,6 +101,17 @@ async def docker_cmd(args: list[str], timeout: int = 20):
async def docker_watchdog(container_map, notify, bot, chat_id): async def docker_watchdog(container_map, notify, bot, chat_id):
last = {} last = {}
while True: while True:
if not last:
for alias, real in container_map.items():
rc, state = await docker_cmd(
["inspect", "-f", "{{.State.Status}}", real],
timeout=10
)
if rc != 0:
state = "error"
last[alias] = state.strip()
await asyncio.sleep(120)
continue
for alias, real in container_map.items(): for alias, real in container_map.items():
rc, state = await docker_cmd( rc, state = await docker_cmd(
["inspect", "-f", "{{.State.Status}}", real], ["inspect", "-f", "{{.State.Status}}", real],