From 884f1834f9ecbbab8a9866bfd9167e0206f68737 Mon Sep 17 00:00:00 2001 From: MobilettoSoft Date: Mon, 13 Apr 2026 19:48:58 +0200 Subject: [PATCH] PUN tariff: don't fail if next day data is not available (#29092) --- tariff/pun.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tariff/pun.go b/tariff/pun.go index a60f0fd88..85c9baaae 100644 --- a/tariff/pun.go +++ b/tariff/pun.go @@ -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