Skip to content

Commit 83213d4

Browse files
committed
chore: adjust min backoff from 1s to 10s
1 parent 90ed01e commit 83213d4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

component/resource/fetcher.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ func (f *Fetcher[V]) updateWithLog() {
221221

222222
func NewFetcher[V any](name string, interval time.Duration, vehicle types.Vehicle, parser Parser[V], onUpdate func(V)) *Fetcher[V] {
223223
ctx, cancel := context.WithCancel(context.Background())
224+
minBackoff := 10 * time.Second
225+
if interval < minBackoff {
226+
minBackoff = interval
227+
}
224228
return &Fetcher[V]{
225229
ctx: ctx,
226230
ctxCancel: cancel,
@@ -232,7 +236,7 @@ func NewFetcher[V any](name string, interval time.Duration, vehicle types.Vehicl
232236
backoff: slowdown.Backoff{
233237
Factor: 2,
234238
Jitter: false,
235-
Min: time.Second,
239+
Min: minBackoff,
236240
Max: interval,
237241
},
238242
}

0 commit comments

Comments
 (0)