소스 검색

Add ability to restart

ElMoribond 3 년 전
부모
커밋
fe2e32c84f
1개의 변경된 파일2개의 추가작업 그리고 5개의 파일을 삭제
  1. 2 5
      frigate/util.py

+ 2 - 5
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: