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