From ad7276119f6fc67416be8eecc7517b030a10df64 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Fri, 29 Nov 2024 14:50:44 +0100 Subject: [PATCH] debug errors --- Makefile | 2 +- src/codegate/storage/storage_engine.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ebb4b265..673cf321 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ lint: poetry run ruff check . test: - poetry run pytest + poetry run pytest -s security: poetry run bandit -r src/ diff --git a/src/codegate/storage/storage_engine.py b/src/codegate/storage/storage_engine.py index 7bf97015..c02c3775 100644 --- a/src/codegate/storage/storage_engine.py +++ b/src/codegate/storage/storage_engine.py @@ -39,13 +39,22 @@ def __init__(self, data_path='./weaviate_data'): self.schema_config = schema_config # setup schema for weaviate + print("before get client") weaviate_client = self.get_client(self.data_path) + print("after get client") if weaviate_client is not None: try: + print("before connect") weaviate_client.connect() + print("before setup schema") self.setup_schema(weaviate_client) + print("after setup schema") + except Exception as e: + self.__logger.error(f"Failed to connect or setup schema: {str(e)}") finally: + print("before close") weaviate_client.close() + print("after close") else: self.__logger.error("Could not find client, skipping schema setup.")