From 8b35ac04bf34d9f2ce150061347680d4c5a305dd Mon Sep 17 00:00:00 2001
From: Ming Deng <mindeng@ebay.com>
Date: Sun, 10 Nov 2019 21:42:43 +0800
Subject: [PATCH] Fix BUG: The registryProtocol should be singleton

---
 registry/protocol/protocol.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/registry/protocol/protocol.go b/registry/protocol/protocol.go
index 534a4b945..ffdb2753d 100644
--- a/registry/protocol/protocol.go
+++ b/registry/protocol/protocol.go
@@ -338,10 +338,10 @@ func setProviderUrl(regURL *common.URL, providerURL *common.URL) {
 }
 
 func GetProtocol() protocol.Protocol {
-	if regProtocol != nil {
-		return regProtocol
+	if regProtocol == nil {
+		regProtocol = newRegistryProtocol()
 	}
-	return newRegistryProtocol()
+	return regProtocol
 }
 
 type wrappedInvoker struct {
-- 
GitLab