Commit fb2cf1d
committed
Add rate limit handling and retry logic***
This commit adds rate limit handling and retry logic to the HTTP client. It introduces a new function `parseRateLimitHeaders` that parses rate limit headers and determines the wait duration before retrying. It also modifies the `executeRequestWithRetries` function to handle rate limit errors separately and wait before retrying. This improves the resilience of the HTTP client when dealing with rate limits and transient errors.1 parent 33c8219 commit fb2cf1d
File tree
2 files changed
+59
-16
lines changed- httpclient
2 files changed
+59
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
32 | 42 | | |
33 | 43 | | |
34 | | - | |
| 44 | + | |
35 | 45 | | |
36 | | - | |
| 46 | + | |
37 | 47 | | |
38 | 48 | | |
39 | | - | |
| 49 | + | |
40 | 50 | | |
41 | 51 | | |
42 | 52 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
49 | 64 | | |
50 | 65 | | |
51 | 66 | | |
52 | 67 | | |
53 | 68 | | |
54 | 69 | | |
55 | | - | |
56 | | - | |
57 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
58 | 77 | | |
59 | 78 | | |
60 | 79 | | |
61 | 80 | | |
62 | | - | |
| 81 | + | |
63 | 82 | | |
64 | 83 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
173 | 196 | | |
174 | | - | |
175 | | - | |
| 197 | + | |
| 198 | + | |
176 | 199 | | |
177 | 200 | | |
178 | 201 | | |
179 | | - | |
| 202 | + | |
180 | 203 | | |
181 | 204 | | |
182 | | - | |
183 | | - | |
184 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
185 | 208 | | |
186 | 209 | | |
187 | 210 | | |
| |||
193 | 216 | | |
194 | 217 | | |
195 | 218 | | |
| 219 | + | |
196 | 220 | | |
197 | 221 | | |
198 | 222 | | |
| |||
0 commit comments