Skip to content

Commit 80c47b6

Browse files
committed
Fixed cluster client lock signature
1 parent f347e06 commit 80c47b6

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

redis/client.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,7 +1111,6 @@ def lock(
11111111
Note this value can be overridden by passing a ``blocking``
11121112
argument to ``acquire``.
11131113
1114-
11151114
``blocking_timeout`` indicates the maximum amount of time in seconds to
11161115
spend trying to acquire the lock. A value of ``None`` indicates
11171116
continue trying forever. ``blocking_timeout`` can be specified as a

redis/cluster.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ def lock(
801801
name,
802802
timeout=None,
803803
sleep=0.1,
804+
blocking=True,
804805
blocking_timeout=None,
805806
lock_class=None,
806807
thread_local=True,
@@ -816,6 +817,12 @@ def lock(
816817
when the lock is in blocking mode and another client is currently
817818
holding the lock.
818819
820+
``blocking`` indicates whether calling ``acquire`` should block until
821+
the lock has been acquired or to fail immediately, causing ``acquire``
822+
to return False and the lock not being acquired. Defaults to True.
823+
Note this value can be overridden by passing a ``blocking``
824+
argument to ``acquire``.
825+
819826
``blocking_timeout`` indicates the maximum amount of time in seconds to
820827
spend trying to acquire the lock. A value of ``None`` indicates
821828
continue trying forever. ``blocking_timeout`` can be specified as a
@@ -858,6 +865,7 @@ def lock(
858865
name,
859866
timeout=timeout,
860867
sleep=sleep,
868+
blocking=blocking,
861869
blocking_timeout=blocking_timeout,
862870
thread_local=thread_local,
863871
)

0 commit comments

Comments
 (0)