From 05df9381b8dd4d55d0e4a713ac75bf640488d4bd Mon Sep 17 00:00:00 2001 From: Jeremy Mayeres <1524722+jerr0328@users.noreply.github.com> Date: Thu, 11 Nov 2021 14:51:58 +0100 Subject: [PATCH] Improve documentation about Lock Specify units for `timeout` and `sleep`. --- redis/lock.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redis/lock.py b/redis/lock.py index 326dbaf98e..d2297526a0 100644 --- a/redis/lock.py +++ b/redis/lock.py @@ -76,14 +76,14 @@ def __init__(self, redis, name, timeout=None, sleep=0.1, Create a new Lock instance named ``name`` using the Redis client supplied by ``redis``. - ``timeout`` indicates a maximum life for the lock. + ``timeout`` indicates a maximum life for the lock in seconds. By default, it will remain locked until release() is called. ``timeout`` can be specified as a float or integer, both representing the number of seconds to wait. - ``sleep`` indicates the amount of time to sleep per loop iteration - when the lock is in blocking mode and another client is currently - holding the lock. + ``sleep`` indicates the amount of time to sleep in seconds per loop + iteration when the lock is in blocking mode and another client is + currently holding the lock. ``blocking`` indicates whether calling ``acquire`` should block until the lock has been acquired or to fail immediately, causing ``acquire``