mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-08 07:42:47 +03:00
Guard lookups when adding/deleting cameras at runtime (#23994)
* Guard object processor queue handlers against unknown cameras * Skip embeddings post processing for removed cameras * End review segments for removed cameras * Drop queued autotracker moves for removed cameras * Release tracked event thumbnails when skipping a removed camera * Add locked accessors for camera states * Read camera states through the processor accessors * Guard output and recording paths against cameras not yet known * Resolve camera state once in ONVIF, notification, and transcription paths
This commit is contained in:
committed by
Nicolas Mowen
parent
d6a18e79aa
commit
d78f6a7a98
@@ -418,6 +418,11 @@ class ReviewSegmentMaintainer(threading.Thread):
|
||||
|
||||
return None
|
||||
|
||||
def _handle_camera_removed(self, camera: str) -> None:
|
||||
"""Close out a deleted camera's segment so a reused name cannot inherit it."""
|
||||
self.forcibly_end_segment(camera)
|
||||
self.indefinite_events.pop(camera, None)
|
||||
|
||||
def update_existing_segment(
|
||||
self,
|
||||
segment: PendingReviewSegment,
|
||||
@@ -666,6 +671,10 @@ class ReviewSegmentMaintainer(threading.Thread):
|
||||
for camera in updated_topics["enabled"]:
|
||||
self.forcibly_end_segment(camera)
|
||||
|
||||
if "remove" in updated_topics:
|
||||
for camera in updated_topics["remove"]:
|
||||
self._handle_camera_removed(camera)
|
||||
|
||||
result = self.detection_subscriber.check_for_update(timeout=1)
|
||||
|
||||
if not result:
|
||||
|
||||
Reference in New Issue
Block a user