From b3b58a880c398c629e3b52a61b04749b2790ea03 Mon Sep 17 00:00:00 2001 From: Andrew Thornton Date: Wed, 22 Dec 2021 11:03:25 +0000 Subject: [PATCH] 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 --- cmd/serv.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/serv.go b/cmd/serv.go index c3c9eff195dd..bb600c8d5012 100644 --- a/cmd/serv.go +++ b/cmd/serv.go @@ -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) }