parent
8d5c3d3d0b
commit
63cb160cb1
@ -14,6 +14,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
@ -277,6 +278,11 @@ func SetEngine() (err error) {
|
|||||||
// so use log file to instead print to stdout.
|
// so use log file to instead print to stdout.
|
||||||
x.SetLogger(log.XORMLogger)
|
x.SetLogger(log.XORMLogger)
|
||||||
x.ShowSQL(setting.LogSQL)
|
x.ShowSQL(setting.LogSQL)
|
||||||
|
if DbCfg.Type == "mysql" {
|
||||||
|
x.SetMaxIdleConns(0)
|
||||||
|
x.SetConnMaxLifetime(3 * time.Second)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user