Commit 0c197e3
fix: retry on 429 with backoff in BookStackClient.request() (#28)
## Summary
CI was hitting BookStack API rate limits when multiple pipelines ran
concurrently against the same instance (reproduced when opening several
PRs in quick succession).
`request()` now retries up to **3 times** on a 429 response, honouring
the `Retry-After` header (default 10 s) before each attempt. After 3
retries the 429 is thrown as normal.
## Behaviour
| Attempt | Response | Action |
|---|---|---|
| 1 | 429 | Wait `Retry-After` seconds, retry |
| 2 | 429 | Wait `Retry-After` seconds, retry |
| 3 | 429 | Wait `Retry-After` seconds, retry |
| 4 | 429 | Throw (status 429) |
| Any | 2xx | Return response |
## Test plan
- [ ] Functional tests pass without 429 errors on next CI run
- [ ] Unit tests covering retry behaviour added in follow-up PR
(`test/unit-tests`)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Paradoxbound <paradoxbound@paradoxbound.org>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e91816e commit 0c197e3
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
69 | 77 | | |
70 | 78 | | |
71 | 79 | | |
| |||
0 commit comments