Commit 00e8621
fix: prevent infinite loop in _wait_for_finish on persistent 404s (#619)
## Summary
- `_wait_for_finish` could spin indefinitely when polling a non-existent
job
- `seconds_elapsed` was only updated inside the `try` block (on
success), so on persistent 404 errors the timeout check `seconds_elapsed
> 3` always evaluated as `0 > 3 = False`
- Moved the `seconds_elapsed` update into a `finally` block so it is
always updated regardless of success or failure (both sync and async
variants)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 1030dab commit 00e8621
1 file changed
+6
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | 43 | | |
45 | 44 | | |
| |||
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
93 | 95 | | |
94 | 96 | | |
95 | 97 | | |
96 | | - | |
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| |||
0 commit comments