formatting cleanup

This commit is contained in:
Blake Blackshear
2021-02-17 07:23:32 -06:00
parent b8f72a5bcb
commit 39ff49e054
23 changed files with 2621 additions and 1736 deletions

View File

@@ -7,10 +7,11 @@ import signal
logger = logging.getLogger(__name__)
class FrigateWatchdog(threading.Thread):
def __init__(self, detectors, stop_event):
threading.Thread.__init__(self)
self.name = 'frigate_watchdog'
self.name = "frigate_watchdog"
self.detectors = detectors
self.stop_event = stop_event
@@ -29,9 +30,10 @@ class FrigateWatchdog(threading.Thread):
# check the detection processes
for detector in self.detectors.values():
detection_start = detector.detection_start.value
if (detection_start > 0.0 and
now - detection_start > 10):
logger.info("Detection appears to be stuck. Restarting detection process...")
if detection_start > 0.0 and now - detection_start > 10:
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. Exiting frigate...")