mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-21 00:06:44 +01:00
handle exit signals
This commit is contained in:
parent
7a6ffb1032
commit
5afda72b84
@ -228,7 +228,6 @@ class FrigateApp:
|
|||||||
args=(
|
args=(
|
||||||
self.config,
|
self.config,
|
||||||
self.video_output_queue,
|
self.video_output_queue,
|
||||||
self.stop_event,
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
output_processor.daemon = True
|
output_processor.daemon = True
|
||||||
|
@ -1,13 +1,23 @@
|
|||||||
import queue
|
import queue
|
||||||
|
import signal
|
||||||
|
import multiprocessing as mp
|
||||||
from multiprocessing import shared_memory
|
from multiprocessing import shared_memory
|
||||||
from frigate.util import SharedMemoryFrameManager
|
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()
|
frame_manager = SharedMemoryFrameManager()
|
||||||
previous_frames = {}
|
previous_frames = {}
|
||||||
|
|
||||||
while True:
|
while not stop_event.is_set():
|
||||||
try:
|
try:
|
||||||
(
|
(
|
||||||
camera,
|
camera,
|
||||||
|
Loading…
Reference in New Issue
Block a user