mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-24 09:27:17 +00:00
Fix bug when read mysql database max lifetime (#17682)
This commit is contained in:
parent
95d3266bee
commit
29cc169d20
|
@ -91,9 +91,9 @@ func InitDBConfig() {
|
||||||
Database.Timeout = sec.Key("SQLITE_TIMEOUT").MustInt(500)
|
Database.Timeout = sec.Key("SQLITE_TIMEOUT").MustInt(500)
|
||||||
Database.MaxIdleConns = sec.Key("MAX_IDLE_CONNS").MustInt(2)
|
Database.MaxIdleConns = sec.Key("MAX_IDLE_CONNS").MustInt(2)
|
||||||
if Database.UseMySQL {
|
if Database.UseMySQL {
|
||||||
Database.ConnMaxLifetime = sec.Key("CONN_MAX_LIFE_TIME").MustDuration(3 * time.Second)
|
Database.ConnMaxLifetime = sec.Key("CONN_MAX_LIFETIME").MustDuration(3 * time.Second)
|
||||||
} else {
|
} else {
|
||||||
Database.ConnMaxLifetime = sec.Key("CONN_MAX_LIFE_TIME").MustDuration(0)
|
Database.ConnMaxLifetime = sec.Key("CONN_MAX_LIFETIME").MustDuration(0)
|
||||||
}
|
}
|
||||||
Database.MaxOpenConns = sec.Key("MAX_OPEN_CONNS").MustInt(0)
|
Database.MaxOpenConns = sec.Key("MAX_OPEN_CONNS").MustInt(0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue