diff --git a/plugins/helper/database/connutil/cassandra.go b/plugins/helper/database/connutil/cassandra.go index 27fb25195..958bef201 100644 --- a/plugins/helper/database/connutil/cassandra.go +++ b/plugins/helper/database/connutil/cassandra.go @@ -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) diff --git a/plugins/helper/database/connutil/sql.go b/plugins/helper/database/connutil/sql.go index 4a6368560..5067e10d7 100644 --- a/plugins/helper/database/connutil/sql.go +++ b/plugins/helper/database/connutil/sql.go @@ -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" }