Clear ongoing reviews on startup (#11097)

* Add topic to clear ongoing review segments

* Clear ongoing review items on startup
This commit is contained in:
Nicolas Mowen
2024-04-24 07:44:28 -06:00
committed by GitHub
parent 313e7c016c
commit c035241b39
3 changed files with 16 additions and 1 deletions

View File

@@ -19,7 +19,12 @@ from frigate.comms.config_updater import ConfigSubscriber
from frigate.comms.detections_updater import DetectionSubscriber, DetectionTypeEnum
from frigate.comms.inter_process import InterProcessRequestor
from frigate.config import CameraConfig, FrigateConfig
from frigate.const import ALL_ATTRIBUTE_LABELS, CLIPS_DIR, UPSERT_REVIEW_SEGMENT
from frigate.const import (
ALL_ATTRIBUTE_LABELS,
CLEAR_ONGOING_REVIEW_SEGMENTS,
CLIPS_DIR,
UPSERT_REVIEW_SEGMENT,
)
from frigate.events.external import ManualEventState
from frigate.models import ReviewSegment
from frigate.object_processing import TrackedObject
@@ -146,6 +151,9 @@ class ReviewSegmentMaintainer(threading.Thread):
self.stop_event = stop_event
# clear ongoing review segments from last instance
self.requestor.send_data(CLEAR_ONGOING_REVIEW_SEGMENTS, "")
def new_segment(
self,
segment: PendingReviewSegment,