Skip to content

Commit 2c8441a

Browse files
committed
Add docstring from review comment
1 parent b45ab06 commit 2c8441a

File tree

1 file changed

+10
-0
lines changed
  • ansible_base/lib/utils

1 file changed

+10
-0
lines changed

ansible_base/lib/utils/db.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ def django_pglocks_advisory_lock(lock_id, shared=False, wait=True, using=None):
119119

120120
@contextmanager
121121
def advisory_lock(*args, lock_session_timeout_milliseconds=0, **kwargs):
122+
"""Context manager that wraps the pglocks advisory lock
123+
124+
This obtains a named lock in postgres, idenfied by the args passed in
125+
usually the lock identifier is a simple string.
126+
127+
@param: wait If True, block until the lock is obtained
128+
@param: shared Whether or not the lock is shared
129+
@param: lock_session_timeout_milliseconds Postgres-level timeout
130+
@param: using django database identifier
131+
"""
122132
if connection.vendor == "postgresql":
123133
cur = None
124134
idle_in_transaction_session_timeout = None

0 commit comments

Comments
 (0)