milvus/internal/proxy/connection/global.go
congqixia 3b5ce73ded
enhance: Change proxy connection manager to concurrent safe (#31008)
See also #31007

This PR:
- Add param item for connection manager behavior: TTL & check interval
- Change clientInfo map to concurrent map

---------

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2024-03-05 10:39:00 +08:00

15 lines
311 B
Go

package connection
import "sync"
var connectionManagerInstance *connectionManager
var getConnectionManagerInstanceOnce sync.Once
func GetManager() *connectionManager {
getConnectionManagerInstanceOnce.Do(func() {
connectionManagerInstance = newConnectionManager()
})
return connectionManagerInstance
}