fix(db): handle advisory lock row shape
This commit is contained in:
parent
bd8fa1fca5
commit
3ff868a3ed
@ -57,6 +57,8 @@ def connect() -> Iterator[psycopg.Connection[Any]]:
|
||||
|
||||
def _try_advisory_lock(conn: psycopg.Connection[Any], lock_id: int) -> bool:
|
||||
row = conn.execute("SELECT pg_try_advisory_lock(%s)", (lock_id,)).fetchone()
|
||||
if isinstance(row, dict):
|
||||
return bool(row.get("pg_try_advisory_lock"))
|
||||
return bool(row and row[0])
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user