diff --git a/bridge-history-api/utils/database.go b/bridge-history-api/utils/database.go index 916372e042..5d7383c165 100644 --- a/bridge-history-api/utils/database.go +++ b/bridge-history-api/utils/database.go @@ -74,6 +74,8 @@ func InitDB(config *config.DBConfig) (*gorm.DB, error) { return nil, pingErr } + sqlDB.SetConnMaxLifetime(time.Minute * 10) + sqlDB.SetConnMaxIdleTime(time.Minute * 5) sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/common/database/db.go b/common/database/db.go index 8d5a54842a..322ba27115 100644 --- a/common/database/db.go +++ b/common/database/db.go @@ -70,6 +70,9 @@ func InitDB(config *Config) (*gorm.DB, error) { return nil, pingErr } + sqlDB.SetConnMaxLifetime(time.Minute * 10) + sqlDB.SetConnMaxIdleTime(time.Minute * 5) + sqlDB.SetMaxOpenConns(config.MaxOpenNum) sqlDB.SetMaxIdleConns(config.MaxIdleNum) diff --git a/common/version/version.go b/common/version/version.go index ca6aadc483..a97953e2db 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -5,7 +5,7 @@ import ( "runtime/debug" ) -var tag = "v4.3.42" +var tag = "v4.3.43" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok {