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 d3a686e commit 2a1f618
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 2a1f618

Please sign in to comment.