cmd/tipgodoc: implement health checking and enable auto-scaling
Change-Id: I860d0913d051616d7958a88a3c7b11a26ec1d4d6 Reviewed-on: https://go-review.googlesource.com/14661 Reviewed-by: Chris Broadfoot <cbro@golang.org>
This commit is contained in:
parent
374b14e99b
commit
6c387a1d07
|
@ -3,12 +3,10 @@ runtime: custom
|
||||||
api_version: go1
|
api_version: go1
|
||||||
vm: true
|
vm: true
|
||||||
|
|
||||||
manual_scaling:
|
automatic_scaling:
|
||||||
instances: 1
|
min_num_instances: 1
|
||||||
|
max_num_instances: 2
|
||||||
|
|
||||||
handlers:
|
handlers:
|
||||||
- url: /.*
|
- url: /.*
|
||||||
script: _go_app
|
script: _go_app
|
||||||
|
|
||||||
health_check:
|
|
||||||
enable_health_check: False
|
|
||||||
|
|
|
@ -71,6 +71,10 @@ func (p *Proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
http.Error(w, s, http.StatusInternalServerError)
|
http.Error(w, s, http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if r.URL.Path == "/_ah/health" {
|
||||||
|
fmt.Fprintln(w, "OK")
|
||||||
|
return
|
||||||
|
}
|
||||||
proxy.ServeHTTP(w, r)
|
proxy.ServeHTTP(w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue