From 450bef4c912335f65c6ccf4905af4636aded7364 Mon Sep 17 00:00:00 2001 From: Igor Ilic Date: Fri, 20 Dec 2024 16:20:40 +0100 Subject: [PATCH] chore: Add logging to sentry when file which should exist can't be found Log to sentry that a file which should exist can't be found Chore COG-475 --- .../databases/relational/sqlalchemy/SqlAlchemyAdapter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py b/cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py index ce3a479e5..c197efc72 100644 --- a/cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py +++ b/cognee/infrastructure/databases/relational/sqlalchemy/SqlAlchemyAdapter.py @@ -1,5 +1,6 @@ import os from os import path +import logging from uuid import UUID from typing import Optional from typing import AsyncGenerator, List @@ -14,6 +15,9 @@ from cognee.modules.data.models.Data import Data from ..ModelBase import Base + +logger = logging.getLogger(__name__) + class SQLAlchemyAdapter(): def __init__(self, connection_string: str): self.db_path: str = None @@ -142,7 +146,7 @@ class SQLAlchemyAdapter(): os.remove(raw_data_location_entities[0].raw_data_location) else: # Report bug as file should exist - pass + logger.error("Local file which should exist can't be found.") await session.execute(delete(Data).where(Data.id == data_id)) await session.commit()