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 8d5c3d3 commit 63cb160Copy full SHA for 63cb160
models/models.go
@@ -14,6 +14,7 @@ import (
14
"path"
15
"path/filepath"
16
"strings"
17
+ "time"
18
19
"code.gitea.io/gitea/modules/log"
20
"code.gitea.io/gitea/modules/setting"
@@ -277,6 +278,11 @@ func SetEngine() (err error) {
277
278
// so use log file to instead print to stdout.
279
x.SetLogger(log.XORMLogger)
280
x.ShowSQL(setting.LogSQL)
281
+ if DbCfg.Type == "mysql" {
282
+ x.SetMaxIdleConns(0)
283
+ x.SetConnMaxLifetime(3 * time.Second)
284
+ }
285
+
286
return nil
287
}
288
0 commit comments