Skip to content

Commit

Permalink
Master namespace id dafult (#558)
Browse files Browse the repository at this point in the history
* default namespaceId

* update version
  • Loading branch information
binbin0325 committed Jan 16, 2023
1 parent cb83715 commit 3b038b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions clients/naming_client/naming_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ func NewNamingClient(nc nacos_client.INacosClient) (*NamingClient, error) {
if err = initLogger(clientConfig); err != nil {
return naming, err
}

if clientConfig.NamespaceId == "" {
clientConfig.NamespaceId = constant.DEFAULT_NAMESPACE_ID
}

naming.serviceInfoHolder = naming_cache.NewServiceInfoHolder(clientConfig.NamespaceId, clientConfig.CacheDir,
clientConfig.UpdateCacheWhenEmpty, clientConfig.NotLoadCacheAtStart)

Expand Down
2 changes: 1 addition & 1 deletion common/constant/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const (
KEY_BEAT = "beat"
KEY_DOM = "dom"
DEFAULT_CONTEXT_PATH = "/nacos"
CLIENT_VERSION = "Nacos-Go-Client:v2.1.2"
CLIENT_VERSION = "Nacos-Go-Client:v2.1.3"
REQUEST_DOMAIN_RETRY_TIME = 3
SERVICE_INFO_SPLITER = "@@"
CONFIG_INFO_SPLITER = "@@"
Expand Down

0 comments on commit 3b038b4

Please sign in to comment.