Disable profiler on live server
This commit is contained in:
parent
7dfaa85a7a
commit
da716fc3aa
@ -3,10 +3,14 @@ package main
|
|||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/pprof"
|
"net/http/pprof"
|
||||||
|
|
||||||
|
"github.com/animenotifier/arn"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
// Uncomment these if you want to enable live profiling via /debug/pprof
|
if !arn.IsDevelopment() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
app.Router.HandlerFunc("GET", "/debug/pprof/", http.HandlerFunc(pprof.Index))
|
app.Router.HandlerFunc("GET", "/debug/pprof/", http.HandlerFunc(pprof.Index))
|
||||||
app.Router.HandlerFunc("GET", "/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
|
app.Router.HandlerFunc("GET", "/debug/pprof/cmdline", http.HandlerFunc(pprof.Cmdline))
|
||||||
|
Loading…
Reference in New Issue
Block a user