Prevent all scanner slave to process requests

This commit is contained in:
2025-12-04 12:18:05 +01:00
parent 0f50c100cf
commit 6a97c5319d

View File

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