Skip to content

Commit

Permalink
Debug docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
dostuffthatmatters committed Nov 17, 2024
1 parent 72a871a commit 5b8cb9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions docs/pages/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -1290,11 +1290,13 @@ Exponential backoff e.g. when errors occur. First try again in 1 minute,
then 4 minutes, then 15 minutes, etc.. Usage:

```python
import src
exponential_backoff = ExponentialBackoff(logger.info)
exponential_backoff = ExponentialBackoff(
log_info=logger.info, buckets= [60, 240, 900, 3600, 14400]
)

while True:
try:
# do something
# do something that might fail
exponential_backoff.reset()
except Exception as e:
logger.exception(e)
Expand Down
8 changes: 5 additions & 3 deletions tum_esm_utils/timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,11 +266,13 @@ class ExponentialBackoff:
then 4 minutes, then 15 minutes, etc.. Usage:
```python
import src
exponential_backoff = ExponentialBackoff(logger.info)
exponential_backoff = ExponentialBackoff(
log_info=logger.info, buckets= [60, 240, 900, 3600, 14400]
)
while True:
try:
# do something
# do something that might fail
exponential_backoff.reset()
except Exception as e:
logger.exception(e)
Expand Down

0 comments on commit 5b8cb9a

Please sign in to comment.