1
0
Fork 0
forked from forgejo/forgejo

[GITEA] Add slow SQL query warning (squash) Fix setting typo

- Fix typo in the slow query threshold setting, add a deprecation warning.
- Resolves #2203

(cherry picked from commit 02f6608e5f)
(cherry picked from commit 4e8f6b2ffd)
This commit is contained in:
Gusted 2024-01-24 16:55:34 +01:00 committed by Earl Warren
parent 464ae81a36
commit 6fb55e9c08
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
3 changed files with 31 additions and 25 deletions

View file

@ -147,9 +147,9 @@ func InitEngine(ctx context.Context) error {
xormEngine.SetConnMaxLifetime(setting.Database.ConnMaxLifetime)
xormEngine.SetDefaultContext(ctx)
if setting.Database.SlowQueryTreshold > 0 {
if setting.Database.SlowQueryThreshold > 0 {
xormEngine.AddHook(&SlowQueryHook{
Treshold: setting.Database.SlowQueryTreshold,
Treshold: setting.Database.SlowQueryThreshold,
Logger: log.GetLogger("xorm"),
})
}