From d6d71421fdf30461dfc43aa4917213bd27feae8d Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 13 May 2025 23:22:36 +0200 Subject: [PATCH] Fix scanner's teardown --- scanner/scanner/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scanner/scanner/__init__.py b/scanner/scanner/__init__.py index 9141090d..28926962 100644 --- a/scanner/scanner/__init__.py +++ b/scanner/scanner/__init__.py @@ -25,10 +25,12 @@ async def lifespan(_): get_db() as db, KyooClient() as client, TheMovieDatabase() as tmdb, - RequestProcessor(db, client, CompositeProvider(tmdb)) as processor, ): # creating the processor makes it listen to requests event in pg - async with get_db() as db: + async with ( + RequestProcessor(db, client, CompositeProvider(tmdb)) as processor, + get_db() as db, + ): scanner = FsScanner(client, RequestCreator(db)) # there's no way someone else used the same id, right? is_master = await db.fetchval("select pg_try_advisory_lock(198347)")