You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2023/09/13 12:21:13 UTC
[dubbo-go] branch main updated: Followup of #2420, rename variable 'one' to 'cacheOnce' (#2423)
This is an automated email from the ASF dual-hosted git repository.
liujun pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git
The following commit(s) were added to refs/heads/main by this push:
new 5ac057d3c Followup of #2420, rename variable 'one' to 'cacheOnce' (#2423)
5ac057d3c is described below
commit 5ac057d3ca6c3c0ea1fa355c6dcdf64a0813c6b9
Author: finalt <fi...@163.com>
AuthorDate: Wed Sep 13 20:21:07 2023 +0800
Followup of #2420, rename variable 'one' to 'cacheOnce' (#2423)
---
.../servicediscovery/service_instances_changed_listener_impl.go | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/registry/servicediscovery/service_instances_changed_listener_impl.go b/registry/servicediscovery/service_instances_changed_listener_impl.go
index 252c97990..de2667bae 100644
--- a/registry/servicediscovery/service_instances_changed_listener_impl.go
+++ b/registry/servicediscovery/service_instances_changed_listener_impl.go
@@ -42,7 +42,7 @@ import (
var (
metaCache *store.CacheManager
- one sync.Once
+ cacheOnce sync.Once
)
func initCache() {
@@ -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),
@@ -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
}