commented out pprof while auth is in place

This commit is contained in:
yashsinghcodes
2026-01-12 20:39:07 +05:30
parent 28fcbc1414
commit 5e80a9e9be
+12 -11
View File
@@ -5,7 +5,7 @@ import (
"github.com/shuffle/shuffle-shared" "github.com/shuffle/shuffle-shared"
singul "github.com/shuffle/singul/pkg" singul "github.com/shuffle/singul/pkg"
"net/http/pprof" //"net/http/pprof"
"archive/zip" "archive/zip"
"bufio" "bufio"
@@ -5703,16 +5703,17 @@ func initHandlers() {
r.HandleFunc("/api/v1/dashboards/{key}/widgets", shuffle.HandleNewWidget).Methods("POST", "OPTIONS") r.HandleFunc("/api/v1/dashboards/{key}/widgets", shuffle.HandleNewWidget).Methods("POST", "OPTIONS")
r.HandleFunc("/api/v1/dashboards/{key}/widgets/{widget_id}", shuffle.HandleGetWidget).Methods("GET", "OPTIONS") r.HandleFunc("/api/v1/dashboards/{key}/widgets/{widget_id}", shuffle.HandleGetWidget).Methods("GET", "OPTIONS")
if strings.ToLower(os.Getenv("SHUFFLE_DEBUG_MEMORY")) == "true" || strings.ToLower(os.Getenv("DEBUG_MEMORY")) == "true" { // Need to add auth in pprof
log.Printf("[DEBUG] Memory debugging is enabled on /debug/pprof") // if strings.ToLower(os.Getenv("SHUFFLE_DEBUG_MEMORY")) == "true" || strings.ToLower(os.Getenv("DEBUG_MEMORY")) == "true" {
r.HandleFunc("/debug/pprof/", pprof.Index) // log.Printf("[DEBUG] Memory debugging is enabled on /debug/pprof")
r.HandleFunc("/debug/pprof/heap", pprof.Handler("heap").ServeHTTP) // r.HandleFunc("/debug/pprof/", pprof.Index)
r.HandleFunc("/debug/pprof/profile", pprof.Profile) // r.HandleFunc("/debug/pprof/heap", pprof.Handler("heap").ServeHTTP)
r.HandleFunc("/debug/pprof/symbol", pprof.Symbol) // r.HandleFunc("/debug/pprof/profile", pprof.Profile)
r.HandleFunc("/debug/pprof/trace", pprof.Trace) // r.HandleFunc("/debug/pprof/symbol", pprof.Symbol)
} else { // r.HandleFunc("/debug/pprof/trace", pprof.Trace)
log.Printf("[DEBUG] Memory debugging is disabled. To enable, set SHUFFLE_DEBUG_MEMORY or DEBUG_MEMORY to true") // } else {
} // log.Printf("[DEBUG] Memory debugging is disabled. To enable, set SHUFFLE_DEBUG_MEMORY or DEBUG_MEMORY to true")
// }
r.Use(shuffle.RequestMiddleware) r.Use(shuffle.RequestMiddleware)
http.Handle("/", r) http.Handle("/", r)