2024-02-20 16:26:09 -07:00
|
|
|
"""Run recording maintainer and cleanup."""
|
|
|
|
|
|
|
|
|
|
import logging
|
2025-06-24 11:41:11 -06:00
|
|
|
from multiprocessing.synchronize import Event as MpEvent
|
2024-02-20 16:26:09 -07:00
|
|
|
|
|
|
|
|
from frigate.config import FrigateConfig
|
2025-07-18 11:23:06 -06:00
|
|
|
from frigate.const import PROCESS_PRIORITY_MED
|
2024-02-20 16:26:09 -07:00
|
|
|
from frigate.review.maintainer import ReviewSegmentMaintainer
|
2025-06-13 11:09:51 -06:00
|
|
|
from frigate.util.process import FrigateProcess
|
2024-02-20 16:26:09 -07:00
|
|
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
2025-06-13 11:09:51 -06:00
|
|
|
class ReviewProcess(FrigateProcess):
|
2025-06-24 11:41:11 -06:00
|
|
|
def __init__(self, config: FrigateConfig, stop_event: MpEvent) -> None:
|
2025-07-18 11:23:06 -06:00
|
|
|
super().__init__(
|
|
|
|
|
stop_event,
|
|
|
|
|
PROCESS_PRIORITY_MED,
|
|
|
|
|
name="frigate.review_segment_manager",
|
|
|
|
|
daemon=True,
|
|
|
|
|
)
|
2025-06-12 12:12:34 -06:00
|
|
|
self.config = config
|
2024-02-20 16:26:09 -07:00
|
|
|
|
2025-06-12 12:12:34 -06:00
|
|
|
def run(self) -> None:
|
2025-06-13 09:43:38 -05:00
|
|
|
self.pre_run_setup(self.config.logger)
|
2025-06-12 12:12:34 -06:00
|
|
|
maintainer = ReviewSegmentMaintainer(
|
|
|
|
|
self.config,
|
|
|
|
|
self.stop_event,
|
|
|
|
|
)
|
|
|
|
|
maintainer.start()
|