mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
update thrift, opencensus, others (#893)
* update thrift, opencensus, others * stats: update to opencensus 0.6.0 view api
This commit is contained in:
7
vendor/github.com/prometheus/common/route/route.go
generated
vendored
7
vendor/github.com/prometheus/common/route/route.go
generated
vendored
@@ -46,6 +46,10 @@ func (r *Router) WithPrefix(prefix string) *Router {
|
||||
|
||||
// handle turns a HandlerFunc into an httprouter.Handle.
|
||||
func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handle {
|
||||
if r.instrh != nil {
|
||||
// This needs to be outside the closure to avoid data race when reading and writing to 'h'.
|
||||
h = r.instrh(handlerName, h)
|
||||
}
|
||||
return func(w http.ResponseWriter, req *http.Request, params httprouter.Params) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
@@ -53,9 +57,6 @@ func (r *Router) handle(handlerName string, h http.HandlerFunc) httprouter.Handl
|
||||
for _, p := range params {
|
||||
ctx = context.WithValue(ctx, param(p.Key), p.Value)
|
||||
}
|
||||
if r.instrh != nil {
|
||||
h = r.instrh(handlerName, h)
|
||||
}
|
||||
h(w, req.WithContext(ctx))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user