change ReadTimeout default value

This commit is contained in:
aler9
2020-07-20 09:09:18 +02:00
parent de32b1f15e
commit a505cbbd25

View File

@@ -42,7 +42,7 @@ type ConnClientConf struct {
Host string Host string
// (optional) timeout for read requests. // (optional) timeout for read requests.
// It defaults to 5 seconds // It defaults to 10 seconds
ReadTimeout time.Duration ReadTimeout time.Duration
// (optional) timeout for write requests. // (optional) timeout for write requests.
@@ -71,7 +71,7 @@ type ConnClient struct {
// NewConnClient allocates a ConnClient. See ConnClientConf for the options. // NewConnClient allocates a ConnClient. See ConnClientConf for the options.
func NewConnClient(conf ConnClientConf) (*ConnClient, error) { func NewConnClient(conf ConnClientConf) (*ConnClient, error) {
if conf.ReadTimeout == time.Duration(0) { if conf.ReadTimeout == time.Duration(0) {
conf.ReadTimeout = 5 * time.Second conf.ReadTimeout = 10 * time.Second
} }
if conf.WriteTimeout == time.Duration(0) { if conf.WriteTimeout == time.Duration(0) {
conf.WriteTimeout = 5 * time.Second conf.WriteTimeout = 5 * time.Second