From 48a073395623d72fd19f7a5b01dc97c0c3bb9913 Mon Sep 17 00:00:00 2001 From: yang <962032265@qq.com> Date: Wed, 14 Sep 2022 12:15:14 +0800 Subject: [PATCH] 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 99c35b22f1..9fbe8f91aa 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 54ed81b601..de3254183f 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 fe8ba4b97a..d669c8c5c3 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 1b0d390d09..a869ab716f 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 {