refactor: cleanup profiling code with equivalent one (backport #16634) (#16635)

This commit is contained in:
mergify[bot] 2023-06-21 16:40:48 +00:00 committed by GitHub
parent 179c6c7451
commit e991124b07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -549,12 +549,7 @@ func wrapCPUProfile(svrCtx *Context, callbackFn func() error) error {
}()
}
errCh := make(chan error)
go func() {
errCh <- callbackFn()
}()
return <-errCh
return callbackFn()
}
// emitServerInfoMetrics emits server info related metrics using application telemetry.