Skip to content

Commit

Permalink
debug errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yrobla committed Nov 29, 2024
1 parent 1a2c5ed commit ad72761
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lint:
poetry run ruff check .

test:
poetry run pytest
poetry run pytest -s

security:
poetry run bandit -r src/
Expand Down
9 changes: 9 additions & 0 deletions src/codegate/storage/storage_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down

0 comments on commit ad72761

Please sign in to comment.