mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-19 19:06:16 +01:00
handle exit signals
This commit is contained in:
parent
7a6ffb1032
commit
5afda72b84
@ -228,7 +228,6 @@ class FrigateApp:
|
||||
args=(
|
||||
self.config,
|
||||
self.video_output_queue,
|
||||
self.stop_event,
|
||||
),
|
||||
)
|
||||
output_processor.daemon = True
|
||||
|
@ -1,13 +1,23 @@
|
||||
import queue
|
||||
import signal
|
||||
import multiprocessing as mp
|
||||
from multiprocessing import shared_memory
|
||||
from frigate.util import SharedMemoryFrameManager
|
||||
|
||||
|
||||
def output_frames(config, video_output_queue, stop_event):
|
||||
def output_frames(config, video_output_queue):
|
||||
stop_event = mp.Event()
|
||||
|
||||
def receiveSignal(signalNumber, frame):
|
||||
stop_event.set()
|
||||
|
||||
signal.signal(signal.SIGTERM, receiveSignal)
|
||||
signal.signal(signal.SIGINT, receiveSignal)
|
||||
|
||||
frame_manager = SharedMemoryFrameManager()
|
||||
previous_frames = {}
|
||||
|
||||
while True:
|
||||
while not stop_event.is_set():
|
||||
try:
|
||||
(
|
||||
camera,
|
||||
|
Loading…
Reference in New Issue
Block a user