Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060 (#801)

* Add ENABLE_PPROF to app.ini and start pprof if true on localhost:6060

* Add comment for golint to blank pprof import
This commit is contained in:
Matthias Loibl 2017-02-05 14:06:25 +01:00 committed by Lunny Xiao
parent c73b7a65f5
commit 17c5e12e6e
2 changed files with 10 additions and 1 deletions

View file

@ -9,6 +9,7 @@ import (
"net"
"net/http"
"net/http/fcgi"
_ "net/http/pprof" // Used for debugging if enabled and a web server is running
"os"
"path"
"strings"
@ -645,6 +646,12 @@ func runWeb(ctx *cli.Context) error {
log.Info("LFS server enabled")
}
if setting.EnablePprof {
go func() {
log.Info("%v", http.ListenAndServe("localhost:6060", nil))
}()
}
var err error
switch setting.Protocol {
case setting.HTTP: