소스 검색

if detection stopped, assume the container needs a restart

Blake Blackshear 4 년 전
부모
커밋
a7bb0931c4
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      frigate/watchdog.py

+ 4 - 2
frigate/watchdog.py

@@ -2,6 +2,8 @@ import datetime
 import logging
 import threading
 import time
+import os
+import signal
 
 logger = logging.getLogger(__name__)
 
@@ -32,5 +34,5 @@ class FrigateWatchdog(threading.Thread):
                     logger.info("Detection appears to be stuck. Restarting detection process")
                     detector.start_or_restart()
                 elif not detector.detect_process.is_alive():
-                    logger.info("Detection appears to have stopped. Restarting detection process")
-                    detector.start_or_restart()
+                    logger.info("Detection appears to have stopped. Restarting frigate")
+                    os.kill(os.getpid(), signal.SIGTERM)