mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:07:31 +00:00
fix(database): add MaxIdleConns
configuration (#4856)
This commit is contained in:
@@ -21,6 +21,7 @@ type Config struct {
|
||||
Port uint16
|
||||
Database string
|
||||
MaxOpenConns uint32
|
||||
MaxIdleConns uint32
|
||||
MaxConnLifetime time.Duration
|
||||
MaxConnIdleTime time.Duration
|
||||
User User
|
||||
@@ -65,6 +66,7 @@ func (c *Config) Connect(useAdmin bool) (*sql.DB, error) {
|
||||
}
|
||||
|
||||
client.SetMaxOpenConns(int(c.MaxOpenConns))
|
||||
client.SetMaxIdleConns(int(c.MaxIdleConns))
|
||||
client.SetConnMaxLifetime(c.MaxConnLifetime)
|
||||
client.SetConnMaxIdleTime(c.MaxConnIdleTime)
|
||||
|
||||
|
@@ -20,6 +20,7 @@ type Config struct {
|
||||
Port int32
|
||||
Database string
|
||||
MaxOpenConns uint32
|
||||
MaxIdleConns uint32
|
||||
MaxConnLifetime time.Duration
|
||||
MaxConnIdleTime time.Duration
|
||||
User User
|
||||
@@ -65,6 +66,7 @@ func (c *Config) Connect(useAdmin bool) (*sql.DB, error) {
|
||||
}
|
||||
|
||||
db.SetMaxOpenConns(int(c.MaxOpenConns))
|
||||
db.SetMaxIdleConns(int(c.MaxIdleConns))
|
||||
db.SetConnMaxLifetime(c.MaxConnLifetime)
|
||||
db.SetConnMaxIdleTime(c.MaxConnIdleTime)
|
||||
|
||||
|
Reference in New Issue
Block a user