From 5c851f1d28d37108908025a29017497950069414 Mon Sep 17 00:00:00 2001 From: Anas Date: Mon, 18 Apr 2022 11:21:54 +0300 Subject: [PATCH] Added blocking parameter to lock --- django_redis/client/default.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/django_redis/client/default.py b/django_redis/client/default.py index 1df90a27..ac01a531 100644 --- a/django_redis/client/default.py +++ b/django_redis/client/default.py @@ -338,9 +338,10 @@ def lock( self, key, version: Optional[int] = None, - timeout=None, - sleep=0.1, - blocking_timeout=None, + timeout: Optional[float] = None, + sleep: float = 0.1, + blocking: bool = True, + blocking_timeout: Optional[float] = None, client: Optional[Redis] = None, thread_local=True, ): @@ -352,6 +353,7 @@ def lock( key, timeout=timeout, sleep=sleep, + blocking=blocking, blocking_timeout=blocking_timeout, thread_local=thread_local, )