Suppress watchdog notifications on startup
This commit is contained in:
@@ -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],
|
||||||
|
|||||||
Reference in New Issue
Block a user