mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 11:27:50 +00:00
move context timeout inside loop, so context gets a fresh deadline
This commit is contained in:
parent
481c85acae
commit
c0d067b7ee
1 changed files with 2 additions and 2 deletions
|
|
@ -1702,14 +1702,14 @@ func confirmNodeDown(uri URI, log logger.Logger) bool {
|
|||
Host: uri.HostPort(),
|
||||
Path: "version",
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(context.Background(), confirmDownTimeout*time.Second)
|
||||
defer cancel()
|
||||
req, err := http.NewRequest("GET", u.String(), nil)
|
||||
if err != nil {
|
||||
log.Printf("bad request:%s %s", u.String(), err)
|
||||
return false
|
||||
}
|
||||
for i := 0; i < confirmDownRetries; i++ {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), confirmDownTimeout*time.Second)
|
||||
defer cancel()
|
||||
resp, err := http.DefaultClient.Do(req.WithContext(ctx))
|
||||
var bod []byte
|
||||
if err == nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue