From deb10fb2a725bc914d8ddb6f6e5e7b509ab0dfad Mon Sep 17 00:00:00 2001 From: Fenny <25108519+Fenny@users.noreply.github.com> Date: Fri, 13 Nov 2020 18:35:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20fix=20duration=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- badger/config.go | 2 +- memory/config.go | 2 +- mysql/config.go | 2 +- postgres/config.go | 2 +- sqlite3/config.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) 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