@@ -17,8 +17,6 @@ package client
17
17
import (
18
18
"context"
19
19
20
- common "github.com/cloudwego-contrib/cwgo-pkg/config/common"
21
-
22
20
"github.com/cloudwego-contrib/cwgo-pkg/config/zookeeper/utils"
23
21
"github.com/cloudwego-contrib/cwgo-pkg/config/zookeeper/zookeeper"
24
22
"github.com/cloudwego/kitex/client"
@@ -29,7 +27,7 @@ import (
29
27
30
28
// WithRPCTimeout sets the RPC timeout policy from zookeeper configuration center.
31
29
func WithRPCTimeout (dest , src string , zookeeperClient zookeeper.Client , opts utils.Options ) []client.Option {
32
- param , err := zookeeperClient .ClientConfigParam (& common .ConfigParamConfig {
30
+ param , err := zookeeperClient .ClientConfigParam (& zookeeper .ConfigParamConfig {
33
31
Category : rpcTimeoutConfigName ,
34
32
ServerServiceName : dest ,
35
33
ClientServiceName : src ,
@@ -58,10 +56,10 @@ func WithRPCTimeout(dest, src string, zookeeperClient zookeeper.Client, opts uti
58
56
func initRPCTimeoutContainer (path string , uniqueID int64 , dest string , zookeeperClient zookeeper.Client ) rpcinfo.TimeoutProvider {
59
57
rpcTimeoutContainer := rpctimeout .NewContainer ()
60
58
61
- onChangeCallback := func (restoreDefault bool , data string , parser common .ConfigParser ) {
59
+ onChangeCallback := func (restoreDefault bool , data string , parser zookeeper .ConfigParser ) {
62
60
configs := map [string ]* rpctimeout.RPCTimeout {}
63
61
if ! restoreDefault {
64
- err := parser .Decode (common . JSON , data , & configs )
62
+ err := parser .Decode (data , & configs )
65
63
if err != nil {
66
64
klog .Warnf ("[zookeeper] %s client zookeeper rpc timeout: unmarshal data %s failed: %s, skip..." , path , data , err )
67
65
return
0 commit comments