Fix parsing the connection duration when it's nil
This commit is contained in:
parent
015e63164b
commit
b1a5f45d2c
|
@ -48,6 +48,9 @@ func (c *CassandraConnectionProducer) Initialize(conf map[string]interface{}, ve
|
|||
}
|
||||
c.Initialized = true
|
||||
|
||||
if c.ConnectTimeoutRaw == nil {
|
||||
c.ConnectTimeoutRaw = "0s"
|
||||
}
|
||||
c.connectTimeout, err = parseutil.ParseDurationSecond(c.ConnectTimeoutRaw)
|
||||
if err != nil {
|
||||
return fmt.Errorf("invalid connect_timeout: %s", err)
|
||||
|
|
|
@ -48,7 +48,7 @@ func (c *SQLConnectionProducer) Initialize(conf map[string]interface{}, verifyCo
|
|||
if c.MaxIdleConnections > c.MaxOpenConnections {
|
||||
c.MaxIdleConnections = c.MaxOpenConnections
|
||||
}
|
||||
if c.MaxConnectionLifetimeRaw == "" {
|
||||
if c.MaxConnectionLifetimeRaw == nil {
|
||||
c.MaxConnectionLifetimeRaw = "0s"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue