From da716fc3aad3c8d2163a44156e2a486d73234079 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Fri, 7 Dec 2018 06:03:35 +0900 Subject: [PATCH] Disable profiler on live server --- profiler.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/profiler.go b/profiler.go index 9f3694fa..06027461 100644 --- a/profiler.go +++ b/profiler.go @@ -3,10 +3,14 @@ package main import ( "net/http" "net/http/pprof" + + "github.com/animenotifier/arn" ) 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/cmdline", http.HandlerFunc(pprof.Cmdline))