Prevent all scanner slave to process requests

This commit is contained in:
Zoe Roux 2025-12-04 12:18:05 +01:00
parent 433b90a3fb
commit 5f9064ec37
No known key found for this signature in database

View File

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