Skip to content

Commit

Permalink
if detection stopped, assume the container needs a restart
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeblackshear committed Jan 27, 2021
1 parent ff99a01 commit a7bb093
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frigate/watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import logging
import threading
import time
import os
import signal

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -32,5 +34,5 @@ def run(self):
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)

0 comments on commit a7bb093

Please sign in to comment.