mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-12-06 06:36:25 +00:00
Prevent all scanner slave to process requests
This commit is contained in:
@@ -24,6 +24,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)
|
||||
|
||||
Reference in New Issue
Block a user