From 0305a7363341e8a52c71b99f0abfb81a75ead150 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 17 Nov 2021 21:28:41 +0800 Subject: [PATCH] Fix bug when read mysql database max lifetime (#17682) (#17690) --- modules/setting/database.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/setting/database.go b/modules/setting/database.go index 3d13ee10c..02b5e43f4 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)