Skip to content

Commit

Permalink
Merge pull request #41 from satisfactorymodding/staging
Browse files Browse the repository at this point in the history
fix: increase slow threshold
  • Loading branch information
Vilsol authored Jan 6, 2024
2 parents 620830d + 43c03ce commit c1eba24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion db/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ func (l *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (stri
}

if logEv != nil {
if len(sql) > 256 {
sql = sql[:256]
}

logEv.Str("file", utils.FileWithLineNum()).
Float64("elapsed", elapsed).
Int64("rows", rows).
Expand All @@ -86,7 +90,7 @@ func InitializePostgres(ctx context.Context) {

dbInit, err := gorm.Open(connection, &gorm.Config{
Logger: &GormLogger{
SlowThreshold: time.Millisecond * 50,
SlowThreshold: time.Second,
},
})
if err != nil {
Expand Down

0 comments on commit c1eba24

Please sign in to comment.