diff options
author | Matthias Loibl <mail@matthiasloibl.com> | 2017-02-05 14:06:25 +0100 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2017-02-05 21:06:25 +0800 |
commit | 17c5e12e6e66da987677384dc734da7c69d1104e (patch) | |
tree | a8350011ed0999156ab4ab035a39f6dddab05c5d /cmd/web.go | |
parent | c73b7a65f5ca4ce580694cf5b4a38b0d2893231a (diff) | |
download | gitea-17c5e12e6e66da987677384dc734da7c69d1104e.tar.gz gitea-17c5e12e6e66da987677384dc734da7c69d1104e.zip |
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
Diffstat (limited to 'cmd/web.go')
-rw-r--r-- | cmd/web.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/web.go b/cmd/web.go index 0af338ee21..edf8ccafe1 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -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: |