mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Fix scanner's teardown
This commit is contained in:
parent
0ef3348e9c
commit
e8deee8e33
@ -25,10 +25,12 @@ async def lifespan(_):
|
|||||||
get_db() as db,
|
get_db() as db,
|
||||||
KyooClient() as client,
|
KyooClient() as client,
|
||||||
TheMovieDatabase() as tmdb,
|
TheMovieDatabase() as tmdb,
|
||||||
RequestProcessor(db, client, CompositeProvider(tmdb)) as processor,
|
|
||||||
):
|
):
|
||||||
# creating the processor makes it listen to requests event in pg
|
# 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))
|
scanner = FsScanner(client, RequestCreator(db))
|
||||||
# there's no way someone else used the same id, right?
|
# there's no way someone else used the same id, right?
|
||||||
is_master = await db.fetchval("select pg_try_advisory_lock(198347)")
|
is_master = await db.fetchval("select pg_try_advisory_lock(198347)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user