mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-15 07:35:27 +03:00
logging
This commit is contained in:
parent
888d702460
commit
f58e230122
@ -23,10 +23,6 @@ class EventMetadataPublisher(Publisher):
|
|||||||
topic = topic.value
|
topic = topic.value
|
||||||
super().__init__(topic)
|
super().__init__(topic)
|
||||||
|
|
||||||
def publish(self, payload: str) -> None:
|
|
||||||
logger.info(f"publishing payload: {payload}")
|
|
||||||
super().publish(payload)
|
|
||||||
|
|
||||||
|
|
||||||
class EventMetadataSubscriber(Subscriber):
|
class EventMetadataSubscriber(Subscriber):
|
||||||
"""Simplifies receiving event metadata."""
|
"""Simplifies receiving event metadata."""
|
||||||
@ -35,7 +31,7 @@ class EventMetadataSubscriber(Subscriber):
|
|||||||
|
|
||||||
def __init__(self, topic: EventMetadataTypeEnum) -> None:
|
def __init__(self, topic: EventMetadataTypeEnum) -> None:
|
||||||
topic = topic.value
|
topic = topic.value
|
||||||
logger.info(f"subscribing to: {topic.value}")
|
logger.info(f"subscribing to: {topic}")
|
||||||
super().__init__(topic)
|
super().__init__(topic)
|
||||||
|
|
||||||
def check_for_update(
|
def check_for_update(
|
||||||
|
|||||||
@ -56,6 +56,7 @@ class EmbeddingMaintainer(threading.Thread):
|
|||||||
|
|
||||||
def run(self) -> None:
|
def run(self) -> None:
|
||||||
"""Maintain a Chroma vector database for semantic search."""
|
"""Maintain a Chroma vector database for semantic search."""
|
||||||
|
logger.info("in maintainer run()")
|
||||||
while not self.stop_event.is_set():
|
while not self.stop_event.is_set():
|
||||||
self._process_updates()
|
self._process_updates()
|
||||||
self._process_finalized()
|
self._process_finalized()
|
||||||
@ -149,12 +150,13 @@ class EmbeddingMaintainer(threading.Thread):
|
|||||||
if event_id in self.tracked_events:
|
if event_id in self.tracked_events:
|
||||||
del self.tracked_events[event_id]
|
del self.tracked_events[event_id]
|
||||||
|
|
||||||
def _process_event_metadata(self, event_id):
|
def _process_event_metadata(self):
|
||||||
# Check for regenerate description requests
|
# Check for regenerate description requests
|
||||||
|
logger.info("processing event metadata")
|
||||||
(topic, event_id) = self.event_metadata_subscriber.check_for_update()
|
(topic, event_id) = self.event_metadata_subscriber.check_for_update()
|
||||||
logger.info(f"in init in maintainer, {topic} {event_id}")
|
logger.info(f"in init in maintainer, {topic} {event_id}")
|
||||||
|
|
||||||
if not topic:
|
if topic is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
if event_id:
|
if event_id:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user