From bc2498addd98345cbcc52bc9de32d8cf82f2b0a7 Mon Sep 17 00:00:00 2001 From: Pavel Muhortov Date: Mon, 1 Jan 2024 17:11:22 +0300 Subject: [PATCH] added watchdog exit reasons description --- cctv-scheduler.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cctv-scheduler.py b/cctv-scheduler.py index ddc497d..f5629fb 100644 --- a/cctv-scheduler.py +++ b/cctv-scheduler.py @@ -565,11 +565,18 @@ class FFmpeg: if que: while True: while not que.empty(): - local_logger.debug(msg=que.get()) + que_str = que.get() + local_logger.debug(msg=que_str) + + trigger = "Delay between the first packet and last packet in the muxing queue" + if re.match(".*" + trigger + ".*", que_str): + Proc.kill(pid) + local_logger.debug(msg='exit by watchdog, reason: ' + trigger) sleep(sec) if que.empty(): Proc.kill(pid) - local_logger.debug(msg='exit by watchdog') + trigger = "que is empty for " + str(sec) + " seconds" + local_logger.debug(msg='exit by watchdog, reason: ' + trigger) break exit()