diff --git a/clients/naming_client/naming_cache/service_info_holder.go b/clients/naming_client/naming_cache/service_info_holder.go index d10bb9bc..c0a8791c 100644 --- a/clients/naming_client/naming_cache/service_info_holder.go +++ b/clients/naming_client/naming_cache/service_info_holder.go @@ -43,10 +43,10 @@ func NewServiceInfoHolder(namespace, cacheDir string, updateCacheWhenEmpty, notL cacheDir: cacheDir, subCallback: NewSubscribeCallback(), UpdateTimeMap: cache.NewConcurrentMap(), + ServiceInfoMap: cache.NewConcurrentMap(), } - if notLoadCacheAtStart { - serviceInfoHolder.ServiceInfoMap = cache.NewConcurrentMap() - } else { + + if !notLoadCacheAtStart { serviceInfoHolder.loadCacheFromDisk() } return serviceInfoHolder