chore: fix backoffs limited to 15min (#25805)
This commit is contained in:
parent
9eefcf1a6e
commit
243e6d0018
3 changed files with 4 additions and 3 deletions
|
|
@ -228,7 +228,7 @@ func (c *Easee) chargerSite(charger string) (easee.Site, error) {
|
|||
|
||||
// connect creates an HTTP connection to the signalR hub
|
||||
func (c *Easee) connect(ts oauth2.TokenSource) func() (signalr.Connection, error) {
|
||||
bo := backoff.NewExponentialBackOff(backoff.WithMaxInterval(time.Minute))
|
||||
bo := backoff.NewExponentialBackOff(backoff.WithMaxInterval(time.Minute), backoff.WithMaxElapsedTime(0))
|
||||
|
||||
return func() (conn signalr.Connection, err error) {
|
||||
defer func() {
|
||||
|
|
|
|||
|
|
@ -163,7 +163,8 @@ func NewSalia(ctx context.Context, uri, user, password string, cache time.Durati
|
|||
func (wb *Salia) heartbeat(ctx context.Context) {
|
||||
bo := backoff.NewExponentialBackOff(
|
||||
backoff.WithInitialInterval(5*time.Second),
|
||||
backoff.WithMaxInterval(time.Minute))
|
||||
backoff.WithMaxInterval(time.Minute),
|
||||
backoff.WithMaxElapsedTime(0))
|
||||
|
||||
for tick := time.Tick(30 * time.Second); ; {
|
||||
select {
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ func NewDsmr(uri, energy string, timeout time.Duration) (api.Meter, error) {
|
|||
// based on https://github.com/basvdlei/gotsmart/blob/master/gotsmart.go
|
||||
func (m *Dsmr) run(conn net.Conn, done chan struct{}) {
|
||||
log := util.NewLogger("dsmr")
|
||||
bo := backoff.NewExponentialBackOff(backoff.WithMaxInterval(5 * time.Minute))
|
||||
bo := backoff.NewExponentialBackOff(backoff.WithMaxInterval(5*time.Minute), backoff.WithMaxElapsedTime(0))
|
||||
|
||||
handle := func(op string, err error) {
|
||||
log.ERROR.Printf("%s: %v", op, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue