From: Scott Gasch Date: Sat, 20 Aug 2022 01:27:57 +0000 (-0700) Subject: Reduce the doctest lease duration... X-Git-Url: https://wannabe.guru.org/gitweb/?a=commitdiff_plain;h=e46158e49121b8a955bb07b73f5bcf9928b79c90;p=python_utils.git Reduce the doctest lease duration... --- 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