fix: Move init kafka pool into once (#37786)

Introduced by #37744

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2024-11-18 21:24:48 +08:00 committed by GitHub
parent 351463b67e
commit 97b7ebbc08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,6 +34,7 @@ var (
)
func initPool() {
initOnce.Do(func() {
pool := conc.NewPool[any](
hardware.GetCPUNum(),
conc.WithPreAlloc(false),
@ -43,6 +44,7 @@ func initPool() {
kafkaCPool.Store(pool)
log.Info("init dynamicPool done", zap.Int("size", hardware.GetCPUNum()))
})
}
// GetSQPool returns the singleton pool instance for search/query operations.