mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-12-23 19:11:14 +01:00
940be5dc6f
* Add review to database * Create main manager for review segments * Upsert and maintain review segments * Update logic for adding new segments * Add api * Support deleting review segments on recording cleanup * Add field for alert labels * Formatting * Logic fixes * Save 16:9 thumbnail for review segment * Ensure that crop is 16:9 * Fix non detected objects being added * Only include true positives * Add sub labels to data
37 lines
933 B
Python
37 lines
933 B
Python
"""Run recording maintainer and cleanup."""
|
|
|
|
import logging
|
|
import multiprocessing as mp
|
|
import signal
|
|
import threading
|
|
from types import FrameType
|
|
from typing import Optional
|
|
|
|
from setproctitle import setproctitle
|
|
|
|
from frigate.config import FrigateConfig
|
|
from frigate.review.maintainer import ReviewSegmentMaintainer
|
|
from frigate.util.services import listen
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def manage_review_segments(config: FrigateConfig) -> None:
|
|
stop_event = mp.Event()
|
|
|
|
def receiveSignal(signalNumber: int, frame: Optional[FrameType]) -> None:
|
|
stop_event.set()
|
|
|
|
signal.signal(signal.SIGTERM, receiveSignal)
|
|
signal.signal(signal.SIGINT, receiveSignal)
|
|
|
|
threading.current_thread().name = "process:review_segment_manager"
|
|
setproctitle("frigate.review_segment_manager")
|
|
listen()
|
|
|
|
maintainer = ReviewSegmentMaintainer(
|
|
config,
|
|
stop_event,
|
|
)
|
|
maintainer.start()
|