Skip to content

Commit 7893f8e

Browse files
author
Justin Fudally
committed
catch error in collectFunc
1 parent df60fa4 commit 7893f8e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

go/logic/throttler.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,16 @@ func (this *Throttler) collectThrottleHTTPStatus(firstThrottlingCollected chan<-
306306
return
307307
}
308308

309-
if sleep, _ := collectFunc(); sleep {
309+
sleep, err := collectFunc()
310+
if err != nil {
311+
// If not told to ignore errors, we'll throttle on HTTP connection issues
312+
if !this.migrationContext.IgnoreHTTPErrors {
313+
log.Errorf("errors occurred during HTTP throttle check: %+v", err)
314+
atomic.StoreInt64(&this.migrationContext.ThrottleHTTPStatusCode, int64(-1))
315+
}
316+
}
317+
318+
if sleep {
310319
time.Sleep(1 * time.Second)
311320
}
312321
}

0 commit comments

Comments
 (0)