diff --git a/badger/config.go b/badger/config.go index 8dc516e6..840e5caf 100644 --- a/badger/config.go +++ b/badger/config.go @@ -41,7 +41,7 @@ func configDefault(config ...Config) Config { if cfg.Database == "" { cfg.Database = ConfigDefault.Database } - if int(cfg.GCInterval) == 0 { + if int(cfg.GCInterval.Seconds()) <= 0 { cfg.GCInterval = ConfigDefault.GCInterval } return cfg diff --git a/memory/config.go b/memory/config.go index 7e144f7b..07d13edb 100644 --- a/memory/config.go +++ b/memory/config.go @@ -26,7 +26,7 @@ func configDefault(config ...Config) Config { cfg := config[0] // Set default values - if int(cfg.GCInterval) == 0 { + if int(cfg.GCInterval.Seconds()) <= 0 { cfg.GCInterval = ConfigDefault.GCInterval } return cfg diff --git a/mysql/config.go b/mysql/config.go index 8ed1316b..fc97a733 100644 --- a/mysql/config.go +++ b/mysql/config.go @@ -96,7 +96,7 @@ func configDefault(config ...Config) Config { if cfg.Table == "" { cfg.Table = ConfigDefault.Table } - if int(cfg.GCInterval) == 0 { + if int(cfg.GCInterval.Seconds()) <= 0 { cfg.GCInterval = ConfigDefault.GCInterval } return cfg diff --git a/postgres/config.go b/postgres/config.go index 1eea3816..0b6a9c23 100644 --- a/postgres/config.go +++ b/postgres/config.go @@ -119,7 +119,7 @@ func configDefault(config ...Config) Config { if cfg.Table == "" { cfg.Table = ConfigDefault.Table } - if int(cfg.GCInterval) == 0 { + if int(cfg.GCInterval.Seconds()) <= 0 { cfg.GCInterval = ConfigDefault.GCInterval } return cfg diff --git a/sqlite3/config.go b/sqlite3/config.go index 0b1f893b..b203391a 100644 --- a/sqlite3/config.go +++ b/sqlite3/config.go @@ -64,7 +64,7 @@ func configDefault(config ...Config) Config { if cfg.Table == "" { cfg.Table = ConfigDefault.Table } - if int(cfg.GCInterval) == 0 { + if int(cfg.GCInterval.Seconds()) <= 0 { cfg.GCInterval = ConfigDefault.GCInterval } return cfg