Skip to content

Commit

Permalink
fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
binbin0325 committed Oct 3, 2020
1 parent f4fed90 commit ab22764
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions clients/config_client/config_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,8 @@ func (client *ConfigClient) ListenConfig(param vo.ConfigParam) (err error) {
content string
md5Str string
)
content, err = cache.ReadConfigFromFile(key, client.configCacheDir)
if err != nil {
content, fileErr := cache.ReadConfigFromFile(key, client.configCacheDir)
if fileErr != nil {
logger.Errorf("[cache.ReadConfigFromFile] error: %+v", err)
}
if len(content) > 0 {
Expand Down
6 changes: 3 additions & 3 deletions clients/config_client/config_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ func TestCancelListenConfig(t *testing.T) {
key := util.GetConfigCacheKey(localConfigTest.DataId, localConfigTest.Group, clientConfigTest.NamespaceId)
cache.WriteConfigToFile(key, client.configCacheDir, "")
listenConfigParam := vo.ConfigParam{
DataId: localConfigTest.DataId,
DataId: "cancel_listen_config",
Group: localConfigTest.Group,
OnChange: func(namespace, group, dataId, data string) {
fmt.Println("group:" + group + ", dataId:" + dataId + ", data:" + data)
Expand All @@ -625,7 +625,7 @@ func TestCancelListenConfig(t *testing.T) {
assert.Nil(t, err)
}()
success, err := client.PublishConfig(vo.ConfigParam{
DataId: localConfigTest.DataId,
DataId: "cancel_listen_config",
Group: localConfigTest.Group,
Content: localConfigTest.Content})
assert.Nil(t, err)
Expand All @@ -639,7 +639,7 @@ func TestCancelListenConfig(t *testing.T) {
client.CancelListenConfig(listenConfigParam)

success, err = client.PublishConfig(vo.ConfigParam{
DataId: localConfigTest.DataId,
DataId: "cancel_listen_config",
Group: localConfigTest.Group,
Content: "abcd"})
assert.Nil(t, err)
Expand Down

0 comments on commit ab22764

Please sign in to comment.