docs: the retry/aretry decorator needs parentheses (@aretry())

Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
dsql committed 2026-10-16 04:40:36 -04:00
1 parent bbfcc4818b
commit 39a28d07f2
2 files changed
+11 -2

No files matched your search

+5
View File
@@ -202,6 +202,11 @@ async def pull():
...
```
The decorator always needs parentheses, even with no kwargs: `@retry()` / `@aretry()`. A
bare `@retry` / `@aretry` is the call form applied to the function: `@retry` runs it once
at import time and replaces it with its return value, and `@aretry` replaces it with a
coroutine that is never awaited.
Knobs: `attempts` (total tries), `backoff` / `factor` / `max_backoff` (delay is
`min(backoff * factor**n, max_backoff)`), `jitter` (full jitter, on by default),
`on=` (tuple of retryable exception types), and `give_up=lambda exc: ...` to stop early