summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-08-19 18:27:57 -0700
committerScott Gasch <[email protected]>2022-08-19 18:27:57 -0700
commite46158e49121b8a955bb07b73f5bcf9928b79c90 (patch)
tree6bbeec8ac1a7c23879dfae124f7664df516c9920
parent4f457d760b6163eec639cf9e7bab4d5b9c1c29f0 (diff)
Reduce the doctest lease duration...
-rwxr-xr-xzookeeper.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/zookeeper.py b/zookeeper.py
index 42771c9..e2e6ce4 100755
--- a/zookeeper.py
+++ b/zookeeper.py
@@ -36,7 +36,10 @@ def obtain_lease(
"""Obtain the named lease before invoking a function and skip
invoking the function if the lease cannot be obtained.
- >>> @obtain_lease(lease_id='zookeeper_doctest')
+ >>> @obtain_lease(
+ ... lease_id='zookeeper_doctest',
+ ... initial_duration=datetime.timedelta(seconds=10),
+ ... )
... def f(name: str) -> int:
... print(f'Hello, {name}')
... return 123