File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 9
9
"net"
10
10
"net/http"
11
11
"net/http/fcgi"
12
+ _ "net/http/pprof" // Used for debugging if enabled and a web server is running
12
13
"os"
13
14
"path"
14
15
"strings"
@@ -645,6 +646,12 @@ func runWeb(ctx *cli.Context) error {
645
646
log .Info ("LFS server enabled" )
646
647
}
647
648
649
+ if setting .EnablePprof {
650
+ go func () {
651
+ log .Info ("%v" , http .ListenAndServe ("localhost:6060" , nil ))
652
+ }()
653
+ }
654
+
648
655
var err error
649
656
switch setting .Protocol {
650
657
case setting .HTTP :
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ import (
30
30
_ "github.com/go-macaron/cache/redis"
31
31
"github.com/go-macaron/session"
32
32
_ "github.com/go-macaron/session/redis" // redis plugin for store session
33
- "gopkg.in/ini.v1"
33
+ ini "gopkg.in/ini.v1"
34
34
"strk.kbt.io/projects/go/libravatar"
35
35
)
36
36
79
79
EnableGzip bool
80
80
LandingPageURL LandingPage
81
81
UnixSocketPermission uint32
82
+ EnablePprof bool
82
83
83
84
SSH = struct {
84
85
Disabled bool `ini:"DISABLE_SSH"`
@@ -591,6 +592,7 @@ please consider changing to GITEA_CUSTOM`)
591
592
StaticRootPath = sec .Key ("STATIC_ROOT_PATH" ).MustString (workDir )
592
593
AppDataPath = sec .Key ("APP_DATA_PATH" ).MustString ("data" )
593
594
EnableGzip = sec .Key ("ENABLE_GZIP" ).MustBool ()
595
+ EnablePprof = sec .Key ("ENABLE_PPROF" ).MustBool (false )
594
596
595
597
switch sec .Key ("LANDING_PAGE" ).MustString ("home" ) {
596
598
case "explore" :
You can’t perform that action at this time.
0 commit comments