Skip to content
Snippets Groups Projects
Commit 5e99201f authored by CodingSinger's avatar CodingSinger
Browse files

use the once.do to init the registryprotocol

parent db27238e
No related branches found
No related tags found
No related merge requests found
......@@ -44,7 +44,8 @@ import (
)
var (
regProtocol = newRegistryProtocol()
regProtocol *registryProtocol
once sync.Once
)
type registryProtocol struct {
......@@ -348,6 +349,9 @@ func setProviderUrl(regURL *common.URL, providerURL *common.URL) {
// GetProtocol ...
func GetProtocol() protocol.Protocol {
once.Do(func() {
regProtocol = newRegistryProtocol()
})
return regProtocol
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment