Skip to content

Commit

Permalink
Cast int to duration
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswinsimon committed Mar 25, 2024
1 parent 86ac5f8 commit 2228b41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/database/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 2228b41

Please sign in to comment.