Commit b7e262ea authored by wangwx's avatar wangwx

change once name

parent d2552d96
......@@ -41,7 +41,7 @@ var (
var (
zkClientPool zookeeperClientPool
once sync.Once
clientPoolOnce sync.Once
)
// ZookeeperClient represents zookeeper Client Configuration
......@@ -113,7 +113,7 @@ func initZookeeperClientPool() {
//NewZookeeperClient will create a ZookeeperClient
func NewZookeeperClient(name string, zkAddrs []string, share bool, opts ...zkClientOption) (*ZookeeperClient, error) {
if share {
once.Do(initZookeeperClientPool)
clientPoolOnce.Do(initZookeeperClientPool)
zkClientPool.Lock()
defer zkClientPool.Unlock()
if zkClient, ok := zkClientPool.zkClient[name]; ok {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment