Skip to content

Commit

Permalink
Close provider at end of lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
pudo committed Jul 17, 2024
1 parent e09f587 commit 520f44d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yente/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from yente.routers import reconcile, search, match, admin
from yente.data import refresh_catalog
from yente.search.indexer import update_index_threaded
from yente.provider import close_provider

log = get_logger("yente")
ExceptionHandler = Callable[[Request, Any], Coroutine[Any, Any, Response]]
Expand All @@ -40,6 +41,7 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
if settings.AUTO_REINDEX:
update_index_threaded()
yield
close_provider()


async def request_middleware(
Expand Down

0 comments on commit 520f44d

Please sign in to comment.