[ARVADOS] updated: 2d16a410f0121806bf847f9e6290dae66e96fc5f
Git user
git at public.curoverse.com
Wed Jul 26 17:19:12 EDT 2017
Summary of changes:
services/keep-web/handler.go | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
via 2d16a410f0121806bf847f9e6290dae66e96fc5f (commit)
from 1af8267a0d11ad9f986aec5ec7853299f3cfeb0e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 2d16a410f0121806bf847f9e6290dae66e96fc5f
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Jul 26 17:14:42 2017 -0400
11906: Remove intermediary servemux and handler func.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curoverse.com>
diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go
index 5648449..16df210 100644
--- a/services/keep-web/handler.go
+++ b/services/keep-web/handler.go
@@ -27,10 +27,10 @@ import (
)
type handler struct {
- Config *Config
- clientPool *arvadosclient.ClientPool
- setupOnce sync.Once
- hmux *http.ServeMux
+ Config *Config
+ clientPool *arvadosclient.ClientPool
+ setupOnce sync.Once
+ healthHandler http.Handler
}
// parseCollectionIDFromDNSName returns a UUID or PDH if s begins with
@@ -75,11 +75,10 @@ func (h *handler) setup() {
keepclient.RefreshServiceDiscoveryOnSIGHUP()
- h.hmux = http.NewServeMux()
- h.hmux.Handle("/_health/", &health.Handler{
+ h.healthHandler = &health.Handler{
Token: h.Config.ManagementToken,
Prefix: "/_health/",
- })
+ }
}
func (h *handler) serveStatus(w http.ResponseWriter, r *http.Request) {
@@ -91,10 +90,6 @@ func (h *handler) serveStatus(w http.ResponseWriter, r *http.Request) {
json.NewEncoder(w).Encode(status)
}
-func (h *handler) healthCheck(w http.ResponseWriter, r *http.Request) {
- h.hmux.ServeHTTP(w, r)
-}
-
// ServeHTTP implements http.Handler.
func (h *handler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
h.setupOnce.Do(h.setup)
@@ -124,7 +119,7 @@ func (h *handler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
}()
if strings.HasPrefix(r.URL.Path, "/_health/") && r.Method == "GET" {
- h.healthCheck(w, r)
+ h.healthHandler.ServeHTTP(w, r)
return
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list