mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Format changes with Black
This commit is contained in:
parent
ccf5250679
commit
a12ccf5d6c
@ -636,7 +636,10 @@ def restart_frigate():
|
|||||||
else:
|
else:
|
||||||
os.kill(os.getpid(), signal.SIGTERM)
|
os.kill(os.getpid(), signal.SIGTERM)
|
||||||
|
|
||||||
def terminate_process(proc: sp.Popen, logger_inst: logging.Logger = None, timeout: float = 30.0):
|
|
||||||
|
def terminate_process(
|
||||||
|
proc: sp.Popen, logger_inst: logging.Logger = None, timeout: float = 30.0
|
||||||
|
):
|
||||||
logger_inst = logger_inst or logger
|
logger_inst = logger_inst or logger
|
||||||
if proc is not None and proc.poll() == None:
|
if proc is not None and proc.poll() == None:
|
||||||
proc_name: str = proc.args[0]
|
proc_name: str = proc.args[0]
|
||||||
@ -651,7 +654,6 @@ def terminate_process(proc: sp.Popen, logger_inst: logging.Logger = None, timeou
|
|||||||
proc.communicate()
|
proc.communicate()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class EventsPerSecond:
|
class EventsPerSecond:
|
||||||
def __init__(self, max_events=1000):
|
def __init__(self, max_events=1000):
|
||||||
self._start = None
|
self._start = None
|
||||||
|
|||||||
@ -400,8 +400,8 @@ def capture_camera(name, config: CameraConfig, process_info):
|
|||||||
def run_capture():
|
def run_capture():
|
||||||
frame_queue = process_info["frame_queue"]
|
frame_queue = process_info["frame_queue"]
|
||||||
prev_sig = None
|
prev_sig = None
|
||||||
logger.info(f"{name}: capture starting")
|
|
||||||
while prev_sig not in stop_sigs:
|
while prev_sig not in stop_sigs:
|
||||||
|
logger.info(f"{name}: capture starting")
|
||||||
camera_watchdog = CameraWatchdog(
|
camera_watchdog = CameraWatchdog(
|
||||||
name,
|
name,
|
||||||
config,
|
config,
|
||||||
@ -426,8 +426,6 @@ def capture_camera(name, config: CameraConfig, process_info):
|
|||||||
if( prev_sig := sig_queue.get() ) in stop_sigs:
|
if( prev_sig := sig_queue.get() ) in stop_sigs:
|
||||||
break
|
break
|
||||||
|
|
||||||
logger.info(f"{name}: capture resuming")
|
|
||||||
|
|
||||||
# Run a background thread to prevent deadlock in signal handlers
|
# Run a background thread to prevent deadlock in signal handlers
|
||||||
capture_thread = threading.Thread(target=run_capture)
|
capture_thread = threading.Thread(target=run_capture)
|
||||||
capture_thread.start()
|
capture_thread.start()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user