Commit 8968be4
committed
feat(http_fetcher): improve network error handling with exponential backoff
Network errors now use exponential backoff strategy instead of fixed
reloadInterval delay, enabling faster recovery from transient issues.
Changes:
- Add networkErrorCount tracking alongside serverErrorCount
- Network errors retry at: 15s → 30s → 60s → cap at reloadInterval
- Gradual log-level escalation: WARN for first 2 attempts, ERROR after
- Extract retry calculation to static HTTPFetcher.calculateBackoffDelay()
- Apply same backoff strategy to WeatherGov initialization retries
- Reset both counters on successful response
Benefits:
- Faster recovery from transient network glitches (15s vs 10min)
- Less log spam for temporary issues (WARN vs ERROR initially)
- Consistent retry behavior across HTTPFetcher and provider init
- Reusable backoff calculation for future providers
Example: SMHI "fetch failed" now retries after 15s instead of 10min.1 parent bf676be commit 8968be4
File tree
2 files changed
+38
-5
lines changed- defaultmodules/weather/providers
- js
2 files changed
+38
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
45 | 62 | | |
46 | 63 | | |
47 | 64 | | |
| |||
71 | 88 | | |
72 | 89 | | |
73 | 90 | | |
| 91 | + | |
74 | 92 | | |
75 | 93 | | |
76 | 94 | | |
| |||
226 | 244 | | |
227 | 245 | | |
228 | 246 | | |
229 | | - | |
| 247 | + | |
230 | 248 | | |
231 | 249 | | |
232 | 250 | | |
| |||
255 | 273 | | |
256 | 274 | | |
257 | 275 | | |
258 | | - | |
| 276 | + | |
259 | 277 | | |
| 278 | + | |
260 | 279 | | |
261 | 280 | | |
262 | 281 | | |
| |||
269 | 288 | | |
270 | 289 | | |
271 | 290 | | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
272 | 298 | | |
273 | 299 | | |
274 | 300 | | |
| |||
277 | 303 | | |
278 | 304 | | |
279 | 305 | | |
280 | | - | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
281 | 314 | | |
282 | 315 | | |
283 | 316 | | |
284 | 317 | | |
285 | 318 | | |
286 | | - | |
| 319 | + | |
287 | 320 | | |
288 | 321 | | |
289 | 322 | | |
| |||
0 commit comments