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:
Andrew Gerrand 2015-03-10 12:13:37 +11:00
parent a160d803d7
commit 3b0cd1bf65
1 changed files with 5 additions and 3 deletions

View File

@ -25,8 +25,9 @@ import (
)
const (
repoURL = "https://go.googlesource.com/"
metaURL = "https://go.googlesource.com/?b=master&format=JSON"
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))