Skip to content

Commit f0c0a6d

Browse files
committed
@GitHK review
1 parent 746fffb commit f0c0a6d

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

packages/service-library/src/servicelib/background_task_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def exclusive_periodic(
2222
2323
Arguments:
2424
client -- The Redis client
25-
task_interval -- the task periodicity
25+
task_interval -- the task interval, i.e. how often the task should run
2626
retry_after -- in case the exclusive lock cannot be acquired or is lost, this is the retry interval
2727
2828
Raises:

packages/service-library/src/servicelib/redis/_decorators.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,19 @@ def exclusive(
4545
[Callable[P, Coroutine[Any, Any, R]]], Callable[P, Coroutine[Any, Any, R]]
4646
]:
4747
"""
48-
Define a method to run exclusively across
49-
processes by leveraging a Redis Lock.
50-
a1f69fdefa14fae2fee03fac7e89f27e44b13aa9
51-
parameters:
52-
redis: the redis client SDK
53-
lock_key: a string as the name of the lock (good practice: app_name:lock_name)
54-
lock_value: some additional data that can be retrieved by another client
55-
56-
Raises:
57-
- ValueError if used incorrectly
58-
- CouldNotAcquireLockError if the lock could not be acquired
59-
- LockLostError if the lock was lost (e.g. due to Redis restart, or TTL was not extended in time)
48+
Define a method to run exclusively across
49+
processes by leveraging a Redis Lock.
50+
51+
Arguments:
52+
redis -- the redis client
53+
lock_key -- a string as the name of the lock (good practice: app_name:lock_name)
54+
lock_value -- some additional data that can be retrieved by another client if None,
55+
it will be automatically filled with the current time and the client name
56+
57+
Raises:
58+
- ValueError if used incorrectly
59+
- CouldNotAcquireLockError if the lock could not be acquired
60+
- LockLostError if the lock was lost (e.g. due to Redis restart, or TTL was not extended in time)
6061
"""
6162

6263
if not lock_key:

0 commit comments

Comments
 (0)