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