mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-02 00:07:11 +01:00
Cleanup handling of first object message (#15480)
This commit is contained in:
parent
d302b6e198
commit
f336a91fee
@ -82,18 +82,23 @@ class EventProcessor(threading.Thread):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if source_type == EventTypeEnum.tracked_object:
|
if source_type == EventTypeEnum.tracked_object:
|
||||||
|
id = event_data["id"]
|
||||||
self.timeline_queue.put(
|
self.timeline_queue.put(
|
||||||
(
|
(
|
||||||
camera,
|
camera,
|
||||||
source_type,
|
source_type,
|
||||||
event_type,
|
event_type,
|
||||||
self.events_in_process.get(event_data["id"]),
|
self.events_in_process.get(id),
|
||||||
event_data,
|
event_data,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if event_type == EventStateEnum.start:
|
# if this is the first message, just store it and continue, its not time to insert it in the db
|
||||||
self.events_in_process[event_data["id"]] = event_data
|
if (
|
||||||
|
event_type == EventStateEnum.start
|
||||||
|
or id not in self.events_in_process
|
||||||
|
):
|
||||||
|
self.events_in_process[id] = event_data
|
||||||
continue
|
continue
|
||||||
|
|
||||||
self.handle_object_detection(event_type, camera, event_data)
|
self.handle_object_detection(event_type, camera, event_data)
|
||||||
@ -123,10 +128,6 @@ class EventProcessor(threading.Thread):
|
|||||||
"""handle tracked object event updates."""
|
"""handle tracked object event updates."""
|
||||||
updated_db = False
|
updated_db = False
|
||||||
|
|
||||||
# if this is the first message, just store it and continue, its not time to insert it in the db
|
|
||||||
if event_type == EventStateEnum.start:
|
|
||||||
self.events_in_process[event_data["id"]] = event_data
|
|
||||||
|
|
||||||
if should_update_db(self.events_in_process[event_data["id"]], event_data):
|
if should_update_db(self.events_in_process[event_data["id"]], event_data):
|
||||||
updated_db = True
|
updated_db = True
|
||||||
camera_config = self.config.cameras[camera]
|
camera_config = self.config.cameras[camera]
|
||||||
|
Loading…
Reference in New Issue
Block a user