Skip to content

Commit

Permalink
Make close function async
Browse files Browse the repository at this point in the history
  • Loading branch information
stellasia committed Dec 6, 2024
1 parent 8834351 commit 82b4598
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def parse(
def get_run_params(self, user_input: dict[str, Any]) -> dict[str, Any]:
return user_input

def close(self) -> None:
async def close(self) -> None:
drivers = self._global_data.get("neo4j_config", {})
for driver_name in drivers:
driver = drivers[driver_name]
Expand Down
6 changes: 3 additions & 3 deletions src/neo4j_graphrag/experimental/pipeline/config/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ async def run(self, user_input: dict[str, Any]) -> PipelineResult:
)
result = await self.pipeline.run(data=run_param)
if self.do_cleaning:
self.close()
await self.close()
return result

def close(self) -> None:
async def close(self) -> None:
logger.debug("PIPELINE_RUNNER: cleaning up (closing instantiated drivers...)")
if self.config:
self.config.close()
await self.config.close()

0 comments on commit 82b4598

Please sign in to comment.