Skip to content

Commit

Permalink
Listening configuration increases the namespace
Browse files Browse the repository at this point in the history
Listening configuration increases the namespace
  • Loading branch information
binbin0325 authored Oct 15, 2020
2 parents 28f2dda + 023e484 commit 4d437b4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clients/config_client/config_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ func longPulling(taskId int) func() error {
params[constant.KEY_LISTEN_CONFIGS] = listeningConfigs

var changed string
changedTmp, err := client.configProxy.ListenConfig(params, len(initializationList) > 0, clientConfig.AccessKey, clientConfig.SecretKey)
changedTmp, err := client.configProxy.ListenConfig(params, len(initializationList) > 0, clientConfig.NamespaceId, clientConfig.AccessKey, clientConfig.SecretKey)
if err == nil {
changed = changedTmp
} else {
Expand Down
6 changes: 5 additions & 1 deletion clients/config_client/config_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (cp *ConfigProxy) DeleteConfigProxy(param vo.ConfigParam, tenant, accessKey
}
}

func (cp *ConfigProxy) ListenConfig(params map[string]string, isInitializing bool, accessKey, secretKey string) (string, error) {
func (cp *ConfigProxy) ListenConfig(params map[string]string, isInitializing bool, tenant, accessKey, secretKey string) (string, error) {
//fixed at 30000ms,avoid frequent request on the server
var listenInterval uint64 = 30000
headers := map[string]string{
Expand All @@ -141,6 +141,10 @@ func (cp *ConfigProxy) ListenConfig(params map[string]string, isInitializing boo

headers["accessKey"] = accessKey
headers["secretKey"] = secretKey

if len(tenant) > 0 {
params["tenant"] = tenant
}
logger.Infof("[client.ListenConfig] request params:%+v header:%+v \n", params, headers)
// In order to prevent the server from handling the delay of the client's long task,
// increase the client's read timeout to avoid this problem.
Expand Down

0 comments on commit 4d437b4

Please sign in to comment.