Skip to content

Commit 363cee5

Browse files
committed
Fix number of idle connections
1 parent f0222da commit 363cee5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

api/pkg/di/container.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ func (container *Container) YugaByteDB() (db *gorm.DB) {
236236
}
237237

238238
sql.SetMaxOpenConns(7)
239+
sql.SetMaxIdleConns(3)
240+
sql.SetConnMaxLifetime(time.Minute * 10)
239241

240242
container.logger.Debug(fmt.Sprintf("Running migrations for yugabyte [%T]", db))
241243
if err = db.AutoMigrate(&entities.Heartbeat{}); err != nil {

0 commit comments

Comments
 (0)