PUN tariff: don't fail if next day data is not available (#29092)
This commit is contained in:
parent
2dbd1a5038
commit
884f1834f9
1 changed files with 5 additions and 2 deletions
|
|
@ -91,12 +91,15 @@ func (t *Pun) run(done chan error) {
|
|||
continue
|
||||
}
|
||||
|
||||
// get tomorrow data
|
||||
// get tomorrow data (may not be available before ~13:00 CET)
|
||||
res, err := backoff.RetryWithData(func() (api.Rates, error) {
|
||||
res, err := t.getData(time.Now().AddDate(0, 0, 1))
|
||||
if errors.Is(err, ErrPunDataNotAvailable) {
|
||||
return res, backoff.Permanent(err)
|
||||
}
|
||||
return res, backoffPermanentError(err)
|
||||
}, bo())
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, ErrPunDataNotAvailable) {
|
||||
once.Do(func() { done <- err })
|
||||
t.log.ERROR.Println(err)
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue