Skip to content
Snippets Groups Projects
Commit d82968b4 authored by aliiohs's avatar aliiohs
Browse files

fix getty const

parent 2c0db95c
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ import (
)
const (
maxWheelTimeSpan = 900e9 // 900s, 15 minute
MaxWheelTimeSpan = 900e9 // 900s, 15 minute
)
/////////////////////////
......@@ -110,9 +110,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(MaxWheelTimeSpan) {
return perrors.WithMessagef(err, "request_timeout %s should be less than %s",
consumerConfig.Request_Timeout, time.Duration(maxWheelTimeSpan))
consumerConfig.Request_Timeout, time.Duration(MaxWheelTimeSpan))
}
}
if consumerConfig.Connect_Timeout != "" {
......
......@@ -18,11 +18,11 @@
package dubbo
import (
"github.com/apache/dubbo-go/config"
"time"
)
import (
"github.com/dubbogo/getty"
perrors "github.com/pkg/errors"
)
......@@ -178,9 +178,9 @@ func (c *ClientConfig) CheckValidity() error {
return perrors.WithMessagef(err, "time.ParseDuration(HeartbeatPeroid{%#v})", c.HeartbeatPeriod)
}
if c.heartbeatPeriod >= time.Duration(getty.MaxWheelTimeSpan) {
if c.heartbeatPeriod >= time.Duration(config.MaxWheelTimeSpan) {
return perrors.WithMessagef(err, "heartbeat_period %s should be less than %s",
c.HeartbeatPeriod, time.Duration(getty.MaxWheelTimeSpan))
c.HeartbeatPeriod, time.Duration(config.MaxWheelTimeSpan))
}
if c.sessionTimeout, err = time.ParseDuration(c.SessionTimeout); err != nil {
......@@ -198,9 +198,9 @@ func (c *ServerConfig) CheckValidity() error {
return perrors.WithMessagef(err, "time.ParseDuration(SessionTimeout{%#v})", c.SessionTimeout)
}
if c.sessionTimeout >= time.Duration(getty.MaxWheelTimeSpan) {
if c.sessionTimeout >= time.Duration(config.MaxWheelTimeSpan) {
return perrors.WithMessagef(err, "session_timeout %s should be less than %s",
c.SessionTimeout, time.Duration(getty.MaxWheelTimeSpan))
c.SessionTimeout, time.Duration(config.MaxWheelTimeSpan))
}
return perrors.WithStack(c.GettySessionParam.CheckValidity())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment