diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-11-17 18:59:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 18:59:23 +0800 |
commit | 29cc169d20fc995072a819da6f996717a9899b3b (patch) | |
tree | 8e891c1f11197e0437d1b0b3dd5f0d62d91613d9 /modules | |
parent | 95d3266bee797cbeb7228d361fe32531737906d2 (diff) | |
download | gitea-29cc169d20fc995072a819da6f996717a9899b3b.tar.gz gitea-29cc169d20fc995072a819da6f996717a9899b3b.zip |
Fix bug when read mysql database max lifetime (#17682)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/setting/database.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/setting/database.go b/modules/setting/database.go index 3d13ee10c8..02b5e43f4a 100644 --- a/modules/setting/database.go +++ b/modules/setting/database.go @@ -91,9 +91,9 @@ func InitDBConfig() { Database.Timeout = sec.Key("SQLITE_TIMEOUT").MustInt(500) Database.MaxIdleConns = sec.Key("MAX_IDLE_CONNS").MustInt(2) 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 { - 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) |