From 2228b410eca26f58a7c0b56da8da1abbf597cffb Mon Sep 17 00:00:00 2001 From: Jeswin Simon Date: Mon, 25 Mar 2024 14:13:49 +0530 Subject: [PATCH] Cast int to duration --- common/database/db.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/database/db.go b/common/database/db.go index 2a3d0773b3..38c09e1ffa 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -71,13 +71,13 @@ func InitDB(config *Config) (*gorm.DB, error) { } if (config.MaxLifetime != 0) { - sqlDB.SetConnMaxLifetime(time.Second * config.MaxLifetime) + sqlDB.SetConnMaxLifetime(time.Second * time.Duration(config.MaxLifetime)) } else { sqlDB.SetConnMaxLifetime(time.Minute * 10) } if (config.MaxIdleTime != 0) { - sqlDB.SetConnMaxIdleTime(time.Second * config.MaxIdleTime) + sqlDB.SetConnMaxIdleTime(time.Second * time.Duration(config.MaxIdleTime)) } else { sqlDB.SetConnMaxIdleTime(time.Minute * 5) }