fix: race error

This commit is contained in:
debugtalk
2021-12-23 18:53:00 +08:00
parent 81b4f6451e
commit 970734607e
4 changed files with 6 additions and 9 deletions
+1 -1
View File
@@ -44,7 +44,7 @@ func startMemoryProfile(file string, duration time.Duration) (err error) {
log.Info().Dur("duration", duration).Msg("Start memory profiling")
time.AfterFunc(duration, func() {
err = pprof.WriteHeapProfile(f)
err := pprof.WriteHeapProfile(f)
if err != nil {
log.Error().Err(err).Msg("failed to write memory profile")
}