diff --git a/frigate/comms/embeddings_updater.py b/frigate/comms/embeddings_updater.py index 6fcaf3903..14dd73ae1 100644 --- a/frigate/comms/embeddings_updater.py +++ b/frigate/comms/embeddings_updater.py @@ -25,9 +25,9 @@ class EmbeddingsResponder: def check_for_request(self, process: Callable) -> None: while True: # load all messages that are queued - logger.debug("Checking for embeddings requests") + print("Checking for embeddings requests") has_message, _, _ = zmq.select([self.socket], [], [], 0.1) - logger.debug(f"has a request? {has_message}") + print(f"has a request? {has_message}") if not has_message: break diff --git a/frigate/embeddings/__init__.py b/frigate/embeddings/__init__.py index d3f1f3afe..ed90ebbb1 100644 --- a/frigate/embeddings/__init__.py +++ b/frigate/embeddings/__init__.py @@ -43,6 +43,7 @@ def manage_embeddings(config: FrigateConfig) -> None: listen() # Configure Frigate DB + print("connecting to db in embed") db = SqliteVecQueueDatabase( config.database.path, pragmas={ @@ -54,6 +55,7 @@ def manage_embeddings(config: FrigateConfig) -> None: load_vec_extension=True, ) models = [Event] + print("binding db to model") db.bind(models) print("creating embedding maintainer") diff --git a/frigate/embeddings/maintainer.py b/frigate/embeddings/maintainer.py index c175f794e..01706d727 100644 --- a/frigate/embeddings/maintainer.py +++ b/frigate/embeddings/maintainer.py @@ -84,7 +84,7 @@ class EmbeddingMaintainer(threading.Thread): def _process_requests(self) -> None: """Process embeddings requests""" - def handle_request(topic: str, data: str) -> str: + def _handle_request(topic: str, data: str) -> str: print(f"Handling embeddings request of type {topic} with data {data}") try: @@ -108,11 +108,11 @@ class EmbeddingMaintainer(threading.Thread): except Exception as e: logger.error(f"Unable to handle embeddings request {e}") - self.embeddings_responder.check_for_request(handle_request) + self.embeddings_responder.check_for_request(_handle_request) def _process_updates(self) -> None: """Process event updates""" - update = self.event_subscriber.check_for_update() + update = self.event_subscriber.check_for_update(timeout=0.1) if update is None: return @@ -150,7 +150,7 @@ class EmbeddingMaintainer(threading.Thread): def _process_finalized(self) -> None: """Process the end of an event.""" while True: - ended = self.event_end_subscriber.check_for_update() + ended = self.event_end_subscriber.check_for_update(timeout=0.1) if ended == None: break @@ -245,7 +245,7 @@ class EmbeddingMaintainer(threading.Thread): def _process_event_metadata(self): # Check for regenerate description requests - (topic, event_id, source) = self.event_metadata_subscriber.check_for_update() + (topic, event_id, source) = self.event_metadata_subscriber.check_for_update(timeout=0.1) if topic is None: return