This is an automated email from the ASF dual-hosted git repository.

alexstocks pushed a commit to branch 3.0
in repository https://gitbox.apache.org/repos/asf/dubbo-go.git


The following commit(s) were added to refs/heads/3.0 by this push:
     new 48a073395 Rft: keep the name of protocol registry plugin consistent 
(#2052)
48a073395 is described below

commit 48a073395623d72fd19f7a5b01dc97c0c3bb9913
Author: yang <[email protected]>
AuthorDate: Wed Sep 14 12:15:14 2022 +0800

    Rft: keep the name of protocol registry plugin consistent (#2052)
---
 config/config_loader.go       | 2 +-
 config/graceful_shutdown.go   | 2 +-
 config/service_config.go      | 2 +-
 registry/protocol/protocol.go | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/config/config_loader.go b/config/config_loader.go
index 99c35b22f..9fbe8f91a 100644
--- a/config/config_loader.go
+++ b/config/config_loader.go
@@ -77,7 +77,7 @@ func registerServiceInstance() {
        if err != nil {
                panic(err)
        }
-       p := extension.GetProtocol(constant.RegistryKey)
+       p := extension.GetProtocol(constant.RegistryProtocol)
        var rp registry.RegistryFactory
        var ok bool
        if rp, ok = p.(registry.RegistryFactory); !ok {
diff --git a/config/graceful_shutdown.go b/config/graceful_shutdown.go
index 54ed81b60..de3254183 100644
--- a/config/graceful_shutdown.go
+++ b/config/graceful_shutdown.go
@@ -119,7 +119,7 @@ func BeforeShutdown() {
 
 func destroyAllRegistries() {
        logger.Info("Graceful shutdown --- Destroy all registriesConfig. ")
-       registryProtocol := extension.GetProtocol(constant.RegistryKey)
+       registryProtocol := extension.GetProtocol(constant.RegistryProtocol)
        registryProtocol.Destroy()
 }
 
diff --git a/config/service_config.go b/config/service_config.go
index fe8ba4b97..d669c8c5c 100644
--- a/config/service_config.go
+++ b/config/service_config.go
@@ -294,7 +294,7 @@ func (s *ServiceConfig) Export() error {
                        s.cacheMutex.Lock()
                        if s.cacheProtocol == nil {
                                logger.Debugf(fmt.Sprintf("First load the 
registry protocol, url is {%v}!", ivkURL))
-                               s.cacheProtocol = 
extension.GetProtocol("registry")
+                               s.cacheProtocol = 
extension.GetProtocol(constant.RegistryProtocol)
                        }
                        s.cacheMutex.Unlock()
 
diff --git a/registry/protocol/protocol.go b/registry/protocol/protocol.go
index 1b0d390d0..a869ab716 100644
--- a/registry/protocol/protocol.go
+++ b/registry/protocol/protocol.go
@@ -70,7 +70,7 @@ type registryProtocol struct {
 }
 
 func init() {
-       extension.SetProtocol("registry", GetProtocol)
+       extension.SetProtocol(constant.RegistryProtocol, GetProtocol)
 }
 
 func newRegistryProtocol() *registryProtocol {

Reply via email to