mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-02-18 00:16:41 +01:00
if detection stopped, assume the container needs a restart
This commit is contained in:
parent
84ed126db6
commit
a7739a0a62
@ -2,6 +2,8 @@ import datetime
|
|||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
|
import os
|
||||||
|
import signal
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -32,5 +34,5 @@ class FrigateWatchdog(threading.Thread):
|
|||||||
logger.info("Detection appears to be stuck. Restarting detection process")
|
logger.info("Detection appears to be stuck. Restarting detection process")
|
||||||
detector.start_or_restart()
|
detector.start_or_restart()
|
||||||
elif not detector.detect_process.is_alive():
|
elif not detector.detect_process.is_alive():
|
||||||
logger.info("Detection appears to have stopped. Restarting detection process")
|
logger.info("Detection appears to have stopped. Restarting frigate")
|
||||||
detector.start_or_restart()
|
os.kill(os.getpid(), signal.SIGTERM)
|
||||||
|
Loading…
Reference in New Issue
Block a user