fix(db): handle advisory lock row shape
This commit is contained in:
parent
44c86e739d
commit
10b9d0aec6
@ -67,7 +67,10 @@ class Database:
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
row = conn.execute("SELECT pg_try_advisory_lock(%s)", (lock_id,)).fetchone()
|
row = conn.execute("SELECT pg_try_advisory_lock(%s)", (lock_id,)).fetchone()
|
||||||
locked = bool(row and row[0])
|
if isinstance(row, dict):
|
||||||
|
locked = bool(row.get("pg_try_advisory_lock"))
|
||||||
|
else:
|
||||||
|
locked = bool(row and row[0])
|
||||||
if not locked:
|
if not locked:
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user