From a5a012dd96a1bd0af5d02468d44b7e23f2350d2f Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 19 Sep 2021 11:45:04 +0200 Subject: [PATCH] dhcp4: increase number of unhealthy cycles --- cmd/dhcp4/dhcp4.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/dhcp4/dhcp4.go b/cmd/dhcp4/dhcp4.go index 4ae4605..67d3dc6 100644 --- a/cmd/dhcp4/dhcp4.go +++ b/cmd/dhcp4/dhcp4.go @@ -53,7 +53,7 @@ func healthy() error { if err != nil { return err } - ctx, canc := context.WithTimeout(context.Background(), 5*time.Second) + ctx, canc := context.WithTimeout(context.Background(), 30*time.Second) defer canc() req = req.WithContext(ctx) resp, err := http.DefaultClient.Do(req) @@ -179,7 +179,7 @@ ObtainOrRenew: } else { unhealthyCycles++ log.Printf("router unhealthy (cycle %d of 5): %v", unhealthyCycles, err) - if unhealthyCycles < 5 { + if unhealthyCycles < 20 { continue // wait until unhealthy for longer } // fallthrough