Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update nacos version to 2.1.2 #106

Merged
merged 9 commits into from
Nov 2, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions database/kv/nacos/config_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
)

import (
"github.com/nacos-group/nacos-sdk-go/clients"
"github.com/nacos-group/nacos-sdk-go/clients/config_client"
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/nacos-group/nacos-sdk-go/v2/clients"
"github.com/nacos-group/nacos-sdk-go/v2/clients/config_client"
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
)

var (
Expand Down Expand Up @@ -120,12 +120,12 @@ func (n *NacosConfigClient) Close() {
n.activeCount--
if n.share {
if n.activeCount == 0 {
n.client = nil
n.client.CloseClient()
atomic.StoreUint32(&n.valid, 0)
delete(configClientPool.configClient, n.name)
}
} else {
n.client = nil
n.client.CloseClient()
atomic.StoreUint32(&n.valid, 0)
delete(configClientPool.configClient, n.name)
}
Expand Down
11 changes: 5 additions & 6 deletions database/kv/nacos/config_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ import (
)

import (
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
"github.com/nacos-group/nacos-sdk-go/v2/vo"

"github.com/stretchr/testify/assert"
)
Expand All @@ -48,7 +48,7 @@ func TestStructAlign(t *testing.T) {
//TestNewNacosConfigClient config client
func TestNewNacosConfigClient(t *testing.T) {

scs := []constant.ServerConfig{*constant.NewServerConfig("console.nacos.io", 80)}
scs := []constant.ServerConfig{*constant.NewServerConfig("console.nacos.io", 8848)}
cc := constant.ClientConfig{TimeoutMs: 5 * 1000, NotLoadCacheAtStart: true}

client1, err := NewNacosConfigClient("nacos", true, scs, cc)
Expand Down Expand Up @@ -80,7 +80,7 @@ func TestNewNacosConfigClient(t *testing.T) {

func TestPublishConfig(t *testing.T) {

scs := []constant.ServerConfig{*constant.NewServerConfig("console.nacos.io", 80)}
scs := []constant.ServerConfig{*constant.NewServerConfig("console.nacos.io", 8848)}

cc := constant.ClientConfig{
AppName: "nacos",
Expand All @@ -89,8 +89,7 @@ func TestPublishConfig(t *testing.T) {
NotLoadCacheAtStart: true,
LogDir: "/tmp/nacos/log",
CacheDir: "/tmp/nacos/cache",
RotateTime: "1h",
MaxAge: 3,
LogRollingConfig: &constant.ClientLogRollingConfig{MaxAge: 3},
LogLevel: "debug",
}

Expand Down
12 changes: 6 additions & 6 deletions database/kv/nacos/naming_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
)

import (
"github.com/nacos-group/nacos-sdk-go/clients"
"github.com/nacos-group/nacos-sdk-go/clients/naming_client"
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/vo"
"github.com/nacos-group/nacos-sdk-go/v2/clients"
"github.com/nacos-group/nacos-sdk-go/v2/clients/naming_client"
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"
"github.com/nacos-group/nacos-sdk-go/v2/vo"
)

var (
Expand Down Expand Up @@ -121,12 +121,12 @@ func (n *NacosNamingClient) Close() {
n.activeCount--
if n.share {
if n.activeCount == 0 {
n.client = nil
n.client.CloseClient()
atomic.StoreUint32(&n.valid, 0)
delete(namingClientPool.namingClient, n.name)
}
} else {
n.client = nil
n.client.CloseClient()
atomic.StoreUint32(&n.valid, 0)
delete(namingClientPool.namingClient, n.name)
}
Expand Down
4 changes: 2 additions & 2 deletions database/kv/nacos/naming_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ import (
)

import (
"github.com/nacos-group/nacos-sdk-go/common/constant"
"github.com/nacos-group/nacos-sdk-go/v2/common/constant"

"github.com/stretchr/testify/assert"
)

func TestNewNacosClient(t *testing.T) {

scs := []constant.ServerConfig{
*constant.NewServerConfig("console.nacos.io", 80),
*constant.NewServerConfig("console.nacos.io", 8848),
}

cc := constant.ClientConfig{
Expand Down
7 changes: 3 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
github.com/k0kubun/pp v3.0.1+incompatible
github.com/mattn/go-isatty v0.0.14
github.com/nacos-group/nacos-sdk-go v1.0.8
github.com/nacos-group/nacos-sdk-go/v2 v2.1.2
github.com/natefinch/lumberjack v2.0.0+incompatible
github.com/pkg/errors v0.9.1
github.com/shirou/gopsutil/v3 v3.22.2
Expand All @@ -20,9 +20,8 @@ require (
go.etcd.io/etcd/client/v3 v3.5.0-alpha.0
go.etcd.io/etcd/server/v3 v3.5.0-alpha.0
go.uber.org/atomic v1.9.0
go.uber.org/zap v1.16.0
go.uber.org/zap v1.21.0
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0
google.golang.org/grpc v1.36.0
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
google.golang.org/grpc v1.48.0
gopkg.in/yaml.v2 v2.4.0
)
Loading