1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-01 17:38:33 +00:00

fix various typos (#7690)

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7690
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: floss4good <floss4good@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
Co-committed-by: Ellen Emilia Anna Zscheile <fogti+devel@ytrizja.de>
This commit is contained in:
Ellen Emilia Anna Zscheile 2025-04-28 06:46:29 +00:00 committed by Earl Warren
parent 9e70ff57b4
commit a0cc05ba92
9 changed files with 21 additions and 22 deletions

View file

@ -187,8 +187,8 @@ func InitEngine(ctx context.Context) error {
if setting.Database.SlowQueryThreshold > 0 {
eng.AddHook(&SlowQueryHook{
Treshold: setting.Database.SlowQueryThreshold,
Logger: log.GetLogger("xorm"),
Threshold: setting.Database.SlowQueryThreshold,
Logger: log.GetLogger("xorm"),
})
}
@ -390,8 +390,8 @@ func (TracingHook) AfterProcess(c *contexts.ContextHook) error {
}
type SlowQueryHook struct {
Treshold time.Duration
Logger log.Logger
Threshold time.Duration
Logger log.Logger
}
var _ contexts.Hook = &SlowQueryHook{}
@ -401,7 +401,7 @@ func (SlowQueryHook) BeforeProcess(c *contexts.ContextHook) (context.Context, er
}
func (h *SlowQueryHook) AfterProcess(c *contexts.ContextHook) error {
if c.ExecuteTime >= h.Treshold {
if c.ExecuteTime >= h.Threshold {
h.Logger.Log(8, log.WARN, "[Slow SQL Query] %s %v - %v", c.SQL, c.Args, c.ExecuteTime)
}
return nil

View file

@ -103,8 +103,8 @@ func TestSlowQuery(t *testing.T) {
// It's not possible to clean this up with XORM, but it's luckily not harmful
// to leave around.
engine.AddHook(&db.SlowQueryHook{
Treshold: time.Second * 10,
Logger: log.GetLogger("slow-query"),
Threshold: time.Second * 10,
Logger: log.GetLogger("slow-query"),
})
// NOOP query.
@ -114,8 +114,8 @@ func TestSlowQuery(t *testing.T) {
assert.False(t, stopped)
engine.AddHook(&db.SlowQueryHook{
Treshold: 0, // Every query should be logged.
Logger: log.GetLogger("slow-query"),
Threshold: 0, // Every query should be logged.
Logger: log.GetLogger("slow-query"),
})
// NOOP query.