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

This commit is contained in:
yihuang 2023-06-21 19:44:02 +08:00 committed by GitHub
parent a827f42ae3
commit c63d5fa75e
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.