diff --git a/config/consumer_config.go b/config/consumer_config.go index 9d283eeca7bbaf5a82f71357853c6b53560b2fe4..09c43d886cc5dafffcf9814964fcbe4e2725588f 100644 --- a/config/consumer_config.go +++ b/config/consumer_config.go @@ -19,6 +19,7 @@ package config import ( "bytes" + "github.com/dubbogo/getty" "time" ) @@ -33,10 +34,6 @@ import ( "github.com/apache/dubbo-go/common/yaml" ) -const ( - MaxWheelTimeSpan = 900e9 // 900s, 15 minute -) - ///////////////////////// // consumerConfig ///////////////////////// @@ -110,9 +107,9 @@ func ConsumerInit(confConFile string) error { if consumerConfig.RequestTimeout, err = time.ParseDuration(consumerConfig.Request_Timeout); err != nil { return perrors.WithMessagef(err, "time.ParseDuration(Request_Timeout{%#v})", consumerConfig.Request_Timeout) } - if consumerConfig.RequestTimeout >= time.Duration(MaxWheelTimeSpan) { + if consumerConfig.RequestTimeout >= time.Duration(getty.MaxWheelTimeSpan) { return perrors.WithMessagef(err, "request_timeout %s should be less than %s", - consumerConfig.Request_Timeout, time.Duration(MaxWheelTimeSpan)) + consumerConfig.Request_Timeout, time.Duration(getty.MaxWheelTimeSpan)) } } if consumerConfig.Connect_Timeout != "" { diff --git a/go.mod b/go.mod index 22912f31bbbbec972105373314a10c43d4a135df..5d14bfb8f415f958fac637a2b6f0bc8286d4ba2f 100644 --- a/go.mod +++ b/go.mod @@ -13,7 +13,7 @@ require ( github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect github.com/creasty/defaults v1.3.0 github.com/docker/go-connections v0.4.0 // indirect - github.com/dubbogo/getty v1.3.8 + github.com/dubbogo/getty v1.3.9 github.com/dubbogo/go-zookeeper v1.0.1 github.com/dubbogo/gost v1.9.0 github.com/elazarl/go-bindata-assetfs v1.0.0 // indirect diff --git a/go.sum b/go.sum index 812afcaaee6fc5330bf3dc5874c3753eb2452b41..59f6ca8b8af26c327e4ba4a44f4e08651740024f 100644 --- a/go.sum +++ b/go.sum @@ -133,8 +133,8 @@ github.com/docker/go-connections v0.3.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5Xh github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/dubbogo/getty v1.3.8 h1:D9VQLlO4df0H+k8lEW+Re1hGymxzQjvvEKOzGNI35sI= -github.com/dubbogo/getty v1.3.8/go.mod h1:JIN5lNZznGnBuoYjlEe/yjNmq7eSjKaawHdnBAdtiEo= +github.com/dubbogo/getty v1.3.9 h1:Ip/4Yl7GyDzt3ddZhjXN1Vmxvo9y/hdtoJ4yFc7czLk= +github.com/dubbogo/getty v1.3.9/go.mod h1:JIN5lNZznGnBuoYjlEe/yjNmq7eSjKaawHdnBAdtiEo= github.com/dubbogo/go-zookeeper v1.0.1 h1:irLzvOsDOTNsN8Sv9tvYYxVu6DCQfLtziZQtUHmZgz8= github.com/dubbogo/go-zookeeper v1.0.1/go.mod h1:fn6n2CAEer3novYgk9ULLwAjuV8/g4DdC2ENwRb6E+c= github.com/dubbogo/gost v1.9.0 h1:UT+dWwvLyJiDotxJERO75jB3Yxgsdy10KztR5ycxRAk= diff --git a/protocol/dubbo/config.go b/protocol/dubbo/config.go index b47ec1cc3422dcbcac921f08888c7a777e72e246..142ce81f1e5c2fdbb387c7ad7c39d97ab5eb1a8f 100644 --- a/protocol/dubbo/config.go +++ b/protocol/dubbo/config.go @@ -18,6 +18,7 @@ package dubbo import ( + "github.com/dubbogo/getty" "time" ) @@ -181,9 +182,9 @@ func (c *ClientConfig) CheckValidity() error { return perrors.WithMessagef(err, "time.ParseDuration(HeartbeatPeroid{%#v})", c.HeartbeatPeriod) } - if c.heartbeatPeriod >= time.Duration(config.MaxWheelTimeSpan) { + if c.heartbeatPeriod >= time.Duration(getty.MaxWheelTimeSpan) { return perrors.WithMessagef(err, "heartbeat_period %s should be less than %s", - c.HeartbeatPeriod, time.Duration(config.MaxWheelTimeSpan)) + c.HeartbeatPeriod, time.Duration(getty.MaxWheelTimeSpan)) } if c.sessionTimeout, err = time.ParseDuration(c.SessionTimeout); err != nil { @@ -201,9 +202,9 @@ func (c *ServerConfig) CheckValidity() error { return perrors.WithMessagef(err, "time.ParseDuration(SessionTimeout{%#v})", c.SessionTimeout) } - if c.sessionTimeout >= time.Duration(config.MaxWheelTimeSpan) { + if c.sessionTimeout >= time.Duration(getty.MaxWheelTimeSpan) { return perrors.WithMessagef(err, "session_timeout %s should be less than %s", - c.SessionTimeout, time.Duration(config.MaxWheelTimeSpan)) + c.SessionTimeout, time.Duration(getty.MaxWheelTimeSpan)) } return perrors.WithStack(c.GettySessionParam.CheckValidity())