Skip to content
Snippets Groups Projects
Commit c0ac9ae9 authored by AlexStocks's avatar AlexStocks
Browse files

Imp: check consumerConfig.RequestTimeout by getty.MaxWheelTimeSpan

parent e7f6abac
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,7 @@ import (
import (
"github.com/creasty/defaults"
"github.com/dubbogo/getty"
perrors "github.com/pkg/errors"
"gopkg.in/yaml.v2"
)
......@@ -118,6 +119,10 @@ 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(getty.MaxWheelTimeSpan) {
return perrors.WithMessagef(err, "request_timeout %s should be less than %s",
consumerConfig.Request_Timeout, time.Duration(getty.MaxWheelTimeSpan))
}
}
if consumerConfig.Connect_Timeout != "" {
if consumerConfig.ConnectTimeout, err = time.ParseDuration(consumerConfig.Connect_Timeout); err != nil {
......
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