Skip to content

Commit

Permalink
lsp: Ensure database connections are closed during shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Dec 1, 2024
1 parent 94b1975 commit ba7e1d5
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ def __init__(self, *args, **kwargs):
self.projects: dict[str, Project] = {}
"""Holds active project instances"""

async def shutdown(self, params: None):
for project in self.projects.values():
await project.close()

def register_project(self, scope: str, dbpath: str | pathlib.Path):
"""Register a project."""
self.logger.debug("Registered project for scope '%s': '%s'", scope, dbpath)
Expand Down

0 comments on commit ba7e1d5

Please sign in to comment.