We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 063fa99 commit c2f3938Copy full SHA for c2f3938
models/models.go
@@ -14,6 +14,7 @@ import (
14
"path"
15
"path/filepath"
16
"strings"
17
+ "time"
18
19
"code.gitea.io/gitea/modules/setting"
20
@@ -278,6 +279,11 @@ func SetEngine() (err error) {
278
279
// so use log file to instead print to stdout.
280
x.SetLogger(NewXORMLogger(setting.LogSQL))
281
x.ShowSQL(setting.LogSQL)
282
+ if DbCfg.Type == "mysql" {
283
+ x.SetMaxIdleConns(0)
284
+ x.SetConnMaxLifetime(3 * time.Second)
285
+ }
286
+
287
return nil
288
}
289
0 commit comments