Skip to content

Commit

Permalink
Followup of #2420, rename variable 'one' to 'cacheOnce' (#2423)
Browse files Browse the repository at this point in the history
  • Loading branch information
FinalT authored Sep 13, 2023
1 parent d10057a commit 5ac057d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (

var (
metaCache *store.CacheManager
one sync.Once
cacheOnce sync.Once
)

func initCache() {
Expand All @@ -65,7 +65,7 @@ type ServiceInstancesChangedListenerImpl struct {
}

func NewServiceInstancesChangedListener(services *gxset.HashSet) registry.ServiceInstancesChangedListener {
one.Do(initCache)
cacheOnce.Do(initCache)
return &ServiceInstancesChangedListenerImpl{
serviceNames: services,
listeners: make(map[string]registry.NotifyListener),
Expand Down Expand Up @@ -216,7 +216,7 @@ func (lstn *ServiceInstancesChangedListenerImpl) GetEventType() reflect.Type {

// GetMetadataInfo get metadata info when MetadataStorageTypePropertyName is null
func GetMetadataInfo(instance registry.ServiceInstance, revision string) (*common.MetadataInfo, error) {
one.Do(initCache)
cacheOnce.Do(initCache)
if metadataInfo, ok := metaCache.Get(revision); ok {
return metadataInfo.(*common.MetadataInfo), nil
}
Expand Down

0 comments on commit 5ac057d

Please sign in to comment.