mirror of
https://github.com/gravitl/netmaker.git
synced 2025-11-06 23:05:57 +08:00
add security to cpu profile
This commit is contained in:
parent
e6656209f9
commit
32dfcecdff
2 changed files with 1 additions and 4 deletions
|
|
@ -46,7 +46,7 @@ func serverHandlers(r *mux.Router) {
|
||||||
r.HandleFunc("/api/server/status", getStatus).Methods(http.MethodGet)
|
r.HandleFunc("/api/server/status", getStatus).Methods(http.MethodGet)
|
||||||
r.HandleFunc("/api/server/usage", logic.SecurityCheck(false, http.HandlerFunc(getUsage))).
|
r.HandleFunc("/api/server/usage", logic.SecurityCheck(false, http.HandlerFunc(getUsage))).
|
||||||
Methods(http.MethodGet)
|
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)
|
Methods(http.MethodPost)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
3
main.go
3
main.go
|
|
@ -51,9 +51,6 @@ func main() {
|
||||||
logic.SetAllocatedIpMap()
|
logic.SetAllocatedIpMap()
|
||||||
defer logic.ClearAllocatedIpMap()
|
defer logic.ClearAllocatedIpMap()
|
||||||
setGarbageCollection()
|
setGarbageCollection()
|
||||||
// Start profiling
|
|
||||||
// profFile := logic.StartCPUProfiling()
|
|
||||||
// defer logic.StopCPUProfiling(profFile)
|
|
||||||
setVerbosity()
|
setVerbosity()
|
||||||
if servercfg.DeployedByOperator() && !servercfg.IsPro {
|
if servercfg.DeployedByOperator() && !servercfg.IsPro {
|
||||||
logic.SetFreeTierLimits()
|
logic.SetFreeTierLimits()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue