Fix parsing the connection duration when it's nil

This commit is contained in:
Brian Kassouf 2017-05-03 13:45:27 -07:00
parent 015e63164b
commit b1a5f45d2c
2 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -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"
}