mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-12-12 08:05:31 -05:00
Prevent all scanner slave to process requests
This commit is contained in:
parent
433b90a3fb
commit
5f9064ec37
@ -26,6 +26,10 @@ async def lifespan(_):
|
||||
):
|
||||
# there's no way someone else used the same id, right?
|
||||
is_master = await db.fetchval("select pg_try_advisory_lock(198347)")
|
||||
is_http = not is_master and await db.fetchval("select pg_try_advisory_lock(645633)")
|
||||
if is_http:
|
||||
yield
|
||||
return
|
||||
if is_master:
|
||||
await migrate()
|
||||
processor = RequestProcessor(pool, client, tmdb)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user