From fe2e32c84f9c42710e95e4c3544f350df62d2058 Mon Sep 17 00:00:00 2001 From: ElMoribond Date: Wed, 23 Jun 2021 09:34:08 +0200 Subject: [PATCH] Add ability to restart --- frigate/util.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/frigate/util.py b/frigate/util.py index f0fc9ad94..dae3845f2 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -17,7 +17,7 @@ from typing import AnyStr import cv2 import matplotlib.pyplot as plt import numpy as np -import psutil +import os logger = logging.getLogger(__name__) @@ -520,10 +520,7 @@ def clipped(obj, frame_shape): def restart_frigate(): - for proc in psutil.process_iter(): - if proc.name().startswith("frigate.detector."): - psutil.Process(proc.pid).terminate() - return + os.kill(os.getpid(), signal.SIGTERM) class EventsPerSecond: