Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only create pprof files for gitea serv if explicitly asked for #18068

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Only create pprof files for gitea serv if explicitly asked for
Currently when ENABLE_PPROF is set gitea serv will create pprof files every time it
is called. This is somewhat surprising as the intention of ENABLE_PPROF is to pprof
the server and the utility of pprof files for examining serv is limited. (Especially
since it has become little more than an API calling shim.)

Should users wish to generate pprof files for serv they can still enable them using
--enable-pprof.

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Dec 22, 2021
commit b3b58a880c398c629e3b52a61b04749b2790ea03
2 changes: 1 addition & 1 deletion cmd/serv.go
Original file line number Diff line number Diff line change
@@ -191,7 +191,7 @@ func runServ(c *cli.Context) error {
return fail("Invalid repo name", "Invalid repo name: %s", reponame)
}

if setting.EnablePprof || c.Bool("enable-pprof") {
if c.Bool("enable-pprof") {
if err := os.MkdirAll(setting.PprofDataPath, os.ModePerm); err != nil {
return fail("Error while trying to create PPROF_DATA_PATH", "Error while trying to create PPROF_DATA_PATH: %v", err)
}