Cleanup debug logging, keep orderBy param for repo.Find

This commit is contained in:
Christoph Kluge
2024-10-31 15:47:45 +01:00
parent 2c8b73e2e2
commit 939dd2320a
3 changed files with 8 additions and 15 deletions

View File

@@ -235,10 +235,10 @@ func (r *JobRepository) Find(
q = q.Where("job.start_time = ?", *startTime)
}
q = q.OrderBy("job.id DESC") // always use newest matching job by db id
q = q.OrderBy("job.id DESC") // always use newest matching job by db id if more than one match
s, args, _ := q.ToSql()
log.Printf("trying to find db job with query: %s | %v", s, args)
// s, args, _ := q.ToSql()
// log.Printf("trying to find db job with query: %s | %v", s, args)
log.Debugf("Timer Find %s", time.Since(start))
return scanJob(q.RunWith(r.stmtCache).QueryRow())