Commit 5a6c422
fix: suppress misleading backoff library log in user_defined_backoff_handler
The backoff library's default logger reported 'Backing off _send(...) for 0.0s'
because user_defined_backoff_handler uses interval=0 (actual sleep happens in
the on_backoff callback). This caused confusion and incorrect bug reports.
Changes:
- Pass logger=None to backoff.on_exception() to suppress the misleading default
log message that reports the interval (0s) instead of the actual sleep time
- Improve sleep_on_ratelimit log to show HTTP status code and actual retry time:
'Rate limit exceeded (HTTP 429). Retrying in {N} seconds.'
- Format elapsed time in log_give_up for consistency
Co-Authored-By: bot_apk <apk@cognition.ai>1 parent 0494fd4 commit 5a6c422
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | | - | |
114 | | - | |
| 114 | + | |
| 115 | + | |
115 | 116 | | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
121 | | - | |
| 122 | + | |
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
0 commit comments