From 57b19e7901b6ea524e91fe822d0d528cd7281301 Mon Sep 17 00:00:00 2001 From: andig Date: Tue, 13 Aug 2024 17:24:11 +0200 Subject: [PATCH] chore: fix simplified backoffs --- tariff/gruenstromindex.go | 2 +- tariff/ngeso.go | 2 +- tariff/pun.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tariff/gruenstromindex.go b/tariff/gruenstromindex.go index 286c6343c..d954a8f40 100644 --- a/tariff/gruenstromindex.go +++ b/tariff/gruenstromindex.go @@ -98,7 +98,7 @@ func (t *GrünStromIndex) run(done chan error) { err := backoff.Retry(func() error { return backoffPermanentError(client.GetJSON(uri, &res)) - }, bo) + }, bo()) if err == nil && res.Err { if s, ok := res.Message.(string); ok { diff --git a/tariff/ngeso.go b/tariff/ngeso.go index c1718ffd6..9df5b24d5 100644 --- a/tariff/ngeso.go +++ b/tariff/ngeso.go @@ -78,7 +78,7 @@ func (t *Ngeso) run(done chan error) { res, err := backoff.RetryWithData(func() (ngeso.CarbonForecastResponse, error) { res, err := tReq.DoRequest(client) return res, backoffPermanentError(err) - }, bo) + }, bo()) if err != nil { once.Do(func() { done <- err }) diff --git a/tariff/pun.go b/tariff/pun.go index 930fe0802..122592826 100644 --- a/tariff/pun.go +++ b/tariff/pun.go @@ -90,7 +90,7 @@ func (t *Pun) run(done chan error) { res, err := backoff.RetryWithData(func() (api.Rates, error) { res, err := t.getData(time.Now().AddDate(0, 0, 1)) return res, backoffPermanentError(err) - }, bo) + }, bo()) if err != nil { once.Do(func() { done <- err }) t.log.ERROR.Println(err)