mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-10-08 23:46:38 +00:00
fix(pvforecast): survive a transient Open-Meteo outage
A single 503 from Open-Meteo answered /v1/prediction/update with 400 and left every provider after PVForecastAkkudoktorLocal unrun: the provider raised on the first failed request, and PredictionContainer.update_data re-raises whatever an enabled provider raises. Open-Meteo returns 503 while it rotates its model runs and 429 when the free tier is briefly saturated; both clear within seconds. Retryable responses (429, 500, 502, 503, 504) and connection errors are now retried three times with a growing pause, matching what the SMARD provider already does. If the fetch still fails and the stored forecast reaches past the run start, that forecast is kept for one more run rather than failing the update - a forecast one run old beats no forecast at all. A cold start with nothing stored still fails, because then there really is no PV forecast.
This commit is contained in:
@@ -241,6 +241,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- `ElecPriceSMARD` now distinguishes a lagging publication from a broken response. A window the
|
||||
source cannot serve yet reports the latest value it does have, instead of claiming the response
|
||||
contained no usable prices.
|
||||
- A weather-API outage no longer takes the whole prediction update with it.
|
||||
`PVForecastAkkudoktorLocal` raised on the first failed Open-Meteo request, and
|
||||
`PredictionContainer.update_data` re-raises whatever an enabled provider raises, so every
|
||||
provider after it was skipped and `/v1/prediction/update` answered 400 - over a 503 that
|
||||
Open-Meteo clears within seconds while rotating its model runs. Retryable responses (429 and
|
||||
5xx) and connection errors are now retried three times with a growing pause, and if the fetch
|
||||
still fails while a stored forecast reaches past the run start, that forecast is kept for one
|
||||
more run instead of failing the update. A cold start with no stored forecast still fails.
|
||||
- `cache_in_file` no longer leaves an empty cache entry behind when the wrapped function raises.
|
||||
The entry was claimed before the call, so every later call within the TTL first failed to read
|
||||
it ("Ran out of input") before refetching. The entry is now created only after the call returns.
|
||||
|
||||
Reference in New Issue
Block a user