diff options
author | kolaente <konrad@kola-entertainments.de> | 2019-06-12 21:41:28 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@gitea.io> | 2019-06-12 21:41:28 +0200 |
commit | f9ec2f89f2265bc1371a6c62359de9816534fa6b (patch) | |
tree | f48b138a457e5ac6cf843bbb38400926704370f7 /modules/pprof | |
parent | Fix database lock when use random repository fallback image (#7166) (diff) | |
download | forgejo-f9ec2f89f2265bc1371a6c62359de9816534fa6b.tar.xz forgejo-f9ec2f89f2265bc1371a6c62359de9816534fa6b.zip |
Add golangci (#6418)
Diffstat (limited to 'modules/pprof')
-rw-r--r-- | modules/pprof/pprof.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/modules/pprof/pprof.go b/modules/pprof/pprof.go index b63904e713..80ad67be3a 100644 --- a/modules/pprof/pprof.go +++ b/modules/pprof/pprof.go @@ -9,6 +9,8 @@ import ( "io/ioutil" "runtime" "runtime/pprof" + + "code.gitea.io/gitea/modules/log" ) // DumpMemProfileForUsername dumps a memory profile at pprofDataPath as memprofile_<username>_<temporary id> @@ -30,9 +32,15 @@ func DumpCPUProfileForUsername(pprofDataPath, username string) (func(), error) { return nil, err } - pprof.StartCPUProfile(f) + err = pprof.StartCPUProfile(f) + if err != nil { + log.Fatal("StartCPUProfile: %v", err) + } return func() { pprof.StopCPUProfile() - f.Close() + err = f.Close() + if err != nil { + log.Fatal("StopCPUProfile Close: %v", err) + } }, nil } |