diff --git a/cognee/infrastructure/databases/graph/kuzu/adapter.py b/cognee/infrastructure/databases/graph/kuzu/adapter.py index 597772785..6f9357c2c 100644 --- a/cognee/infrastructure/databases/graph/kuzu/adapter.py +++ b/cognee/infrastructure/databases/graph/kuzu/adapter.py @@ -150,8 +150,9 @@ class KuzuAdapter(GraphDBInterface): s3_file_storage = S3FileStorage("") - async with self.KUZU_ASYNC_LOCK: - self.connection.execute("CHECKPOINT;") + if self.connection: + async with self.KUZU_ASYNC_LOCK: + self.connection.execute("CHECKPOINT;") s3_file_storage.s3.put(self.temp_graph_file, self.db_path, recursive=True)