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)")