Skip to content

Commit

Permalink
[TO_AMEND] Fix locks docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
msimacek committed Feb 13, 2018
1 parent 770e242 commit 88ce898
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions koschei/locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ def pg_lock(db, namespace, key, block=True, transaction=False, shared=False):
advisory lock.
:param: db Database session
:param: namespace Integer namespace key. Should use one of the constants
:param: namespace Integer namespace identifier. Should use one of the constants
defined in this module.
:param: key Integer identifier of the lock.
:param: block Whether to block waiting for the lock.
:param: transaction Whether the lock should be scoped by the transaction
(unlocks when the transaction ends). Otherwise scoped by the
Expand Down Expand Up @@ -67,7 +68,7 @@ def pg_lock(db, namespace, key, block=True, transaction=False, shared=False):

def pg_unlock(db, namespace, key, shared=False):
"""
Unlocks given advisory lock. Arguments have the same meaning as in pg_lock
Unlocks given advisory session lock. Arguments have the same meaning as in pg_lock
"""
fn_name = 'pg_advisory_unlock'
if shared:
Expand All @@ -77,6 +78,9 @@ def pg_unlock(db, namespace, key, shared=False):


def pg_unlock_all(db):
"""
Unlocks advisory session locks.
"""
db.query(func.pg_advisory_unlock_all()).one()


Expand Down

0 comments on commit 88ce898

Please sign in to comment.