cmd/tipgodoc: increase startup 'health check' deadline
Also use a more reliable implementation. Change-Id: I9e6858c7e9bdb60f1fb4e060e6d4d1b3762b83bc Reviewed-on: https://go-review.googlesource.com/7260 Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
parent
a160d803d7
commit
3b0cd1bf65
|
@ -27,6 +27,7 @@ import (
|
|||
const (
|
||||
repoURL = "https://go.googlesource.com/"
|
||||
metaURL = "https://go.googlesource.com/?b=master&format=JSON"
|
||||
startTimeout = 5 * time.Minute
|
||||
)
|
||||
|
||||
var indexingMsg = []byte("Indexing in progress: result may be inaccurate")
|
||||
|
@ -183,7 +184,8 @@ func initSide(side, goHash, toolsHash string) (godoc *exec.Cmd, hostport string,
|
|||
}
|
||||
}()
|
||||
|
||||
for i := 0; i < 120; i++ {
|
||||
deadline := time.Now().Add(startTimeout)
|
||||
for time.Now().Before(deadline) {
|
||||
time.Sleep(time.Second)
|
||||
var res *http.Response
|
||||
res, err = http.Get(fmt.Sprintf("http://%v/search?q=FALLTHROUGH", hostport))
|
||||
|
|
Loading…
Reference in New Issue