chore: fix simplified backoffs
This commit is contained in:
parent
660f2c6c42
commit
57b19e7901
3 changed files with 3 additions and 3 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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 })
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue