Tweak retry parameters
This commit is contained in:
parent
9d42148c64
commit
097776962c
1 changed files with 2 additions and 4 deletions
6
main.go
6
main.go
|
@ -245,18 +245,16 @@ func metricsHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastErr error
|
|
||||||
ctx, canc := context.WithCancel(context.Background())
|
ctx, canc := context.WithCancel(context.Background())
|
||||||
defer canc()
|
defer canc()
|
||||||
for range retries(ctx, 3, time.Second, 2) {
|
for range retries(ctx, 4, 2*time.Second, 2) {
|
||||||
if err := scrape(); err != nil {
|
if err := scrape(); err != nil {
|
||||||
log.Printf("Scrape error: %v", err)
|
log.Printf("Scrape error: %v", err)
|
||||||
lastErr = err
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Fatalf("Scrape failed, bailing entirely: %v", lastErr)
|
log.Fatal("Multiple scrape attempts failed, aborting entirely")
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
Loading…
Reference in a new issue