diff options
author | Jerry Jacobs <xor-gate@users.noreply.github.com> | 2018-08-07 20:49:18 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@users.noreply.github.com> | 2018-08-07 14:49:18 -0400 |
commit | b1bc08e2686e2aa73aaf2108fdc50d9e700def38 (patch) | |
tree | 5f3f155e6290176c4e0b0aaa1cc557d87df56210 /modules/setting | |
parent | ed3589f4296a17ee201f44dcf6e87f8bd5741d09 (diff) | |
download | gitea-b1bc08e2686e2aa73aaf2108fdc50d9e700def38.tar.gz gitea-b1bc08e2686e2aa73aaf2108fdc50d9e700def38.zip |
cmd/serve: pprof cpu and memory profile dumps to disk (#4560)
Diffstat (limited to 'modules/setting')
-rw-r--r-- | modules/setting/setting.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go index 1dd45f0f77..4a231c1a52 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -111,6 +111,7 @@ var ( LandingPageURL LandingPage UnixSocketPermission uint32 EnablePprof bool + PprofDataPath string SSH = struct { Disabled bool `ini:"DISABLE_SSH"` @@ -775,6 +776,10 @@ func NewContext() { AppDataPath = sec.Key("APP_DATA_PATH").MustString(path.Join(AppWorkPath, "data")) EnableGzip = sec.Key("ENABLE_GZIP").MustBool() EnablePprof = sec.Key("ENABLE_PPROF").MustBool(false) + PprofDataPath = sec.Key("PPROF_DATA_PATH").MustString(path.Join(AppWorkPath, "data/tmp/pprof")) + if !filepath.IsAbs(PprofDataPath) { + PprofDataPath = filepath.Join(AppWorkPath, PprofDataPath) + } switch sec.Key("LANDING_PAGE").MustString("home") { case "explore": |