mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-26 13:47:03 +02:00
Add ability to restart
This commit is contained in:
parent
a4052a9fe5
commit
11d8095cdd
@ -17,6 +17,7 @@ from typing import AnyStr
|
|||||||
import cv2
|
import cv2
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
import psutil
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
@ -518,6 +519,13 @@ def clipped(obj, frame_shape):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def restart_frigate():
|
||||||
|
for proc in psutil.process_iter():
|
||||||
|
if proc.name().startswith("frigate.detector."):
|
||||||
|
psutil.Process(proc.pid).terminate()
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
class EventsPerSecond:
|
class EventsPerSecond:
|
||||||
def __init__(self, max_events=1000):
|
def __init__(self, max_events=1000):
|
||||||
self._start = None
|
self._start = None
|
||||||
|
Loading…
Reference in New Issue
Block a user