Only enables pprof when debugging is enabled
This commit is contained in:
@@ -61,8 +61,13 @@ func createRouter(h *handler) *mux.Router {
|
|||||||
s.HandleFunc("/api/logs", h.fetchLogsBetweenDates)
|
s.HandleFunc("/api/logs", h.fetchLogsBetweenDates)
|
||||||
s.HandleFunc("/api/events/stream", h.streamEvents)
|
s.HandleFunc("/api/events/stream", h.streamEvents)
|
||||||
s.HandleFunc("/version", h.version)
|
s.HandleFunc("/version", h.version)
|
||||||
s.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
|
|
||||||
|
if log.IsLevelEnabled(log.DebugLevel) {
|
||||||
|
s.PathPrefix("/debug/pprof/").Handler(http.DefaultServeMux)
|
||||||
|
}
|
||||||
|
|
||||||
s.PathPrefix("/").Handler(http.StripPrefix(base, http.HandlerFunc(h.index)))
|
s.PathPrefix("/").Handler(http.StripPrefix(base, http.HandlerFunc(h.index)))
|
||||||
|
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user