Skip to content

Commit

Permalink
chore: fix simplified backoffs
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Aug 13, 2024
1 parent 660f2c6 commit 57b19e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tariff/gruenstromindex.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tariff/ngeso.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 })

Expand Down
2 changes: 1 addition & 1 deletion tariff/pun.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 57b19e7

Please sign in to comment.