Skip to content

Commit

Permalink
Merge pull request #265 from flycash/bug/reverseRegistryProtocol
Browse files Browse the repository at this point in the history
Fix: Revert the registryProtocol.GetProtocol() to its original codes
  • Loading branch information
fangyincheng authored Nov 26, 2019
2 parents 6a691cd + 6d939d6 commit d77b772
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
6 changes: 3 additions & 3 deletions registry/protocol/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,10 @@ func setProviderUrl(regURL *common.URL, providerURL *common.URL) {
}

func GetProtocol() protocol.Protocol {
if regProtocol == nil {
regProtocol = newRegistryProtocol()
if regProtocol != nil {
return regProtocol
}
return regProtocol
return newRegistryProtocol()
}

type wrappedInvoker struct {
Expand Down
5 changes: 0 additions & 5 deletions registry/protocol/protocol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,3 @@ func TestExportWithApplicationConfig(t *testing.T) {
v2, _ := regProtocol.bounds.Load(getCacheKey(newUrl))
assert.NotNil(t, v2)
}

func TestGetProtocol(t *testing.T) {
singleton := GetProtocol()
assert.True(t, singleton == GetProtocol())
}

0 comments on commit d77b772

Please sign in to comment.