chore: fix simplified backoffs

This commit is contained in:
andig 2024-08-13 17:24:11 +02:00
parent 660f2c6c42
commit 57b19e7901
3 changed files with 3 additions and 3 deletions

View file

@ -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 {

View file

@ -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 })

View file

@ -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)