add security to cpu profile

This commit is contained in:
abhishek9686 2024-11-08 10:36:25 +04:00
parent e6656209f9
commit 32dfcecdff
2 changed files with 1 additions and 4 deletions

View file

@ -46,7 +46,7 @@ func serverHandlers(r *mux.Router) {
r.HandleFunc("/api/server/status", getStatus).Methods(http.MethodGet)
r.HandleFunc("/api/server/usage", logic.SecurityCheck(false, http.HandlerFunc(getUsage))).
Methods(http.MethodGet)
r.HandleFunc("/api/server/cpu_profile", cpuProfile).
r.HandleFunc("/api/server/cpu_profile", logic.SecurityCheck(false, http.HandlerFunc(cpuProfile))).
Methods(http.MethodPost)
}

View file

@ -51,9 +51,6 @@ func main() {
logic.SetAllocatedIpMap()
defer logic.ClearAllocatedIpMap()
setGarbageCollection()
// Start profiling
// profFile := logic.StartCPUProfiling()
// defer logic.StopCPUProfiling(profFile)
setVerbosity()
if servercfg.DeployedByOperator() && !servercfg.IsPro {
logic.SetFreeTierLimits()