chore: fix backoffs limited to 15min (#25805)

This commit is contained in:
andig 2025-12-04 11:16:25 +01:00 • committed by GitHub
parent 9eefcf1a6e
commit 243e6d0018
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View file

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

View file

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

View file

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