change log to request and sql prints

This commit is contained in:
Christoph Kluge 2024-10-29 18:39:23 +01:00
parent c4a901504d
commit 597ee1dad7
2 changed files with 4 additions and 1 deletions

View File

@ -929,7 +929,7 @@ func (api *RestApi) stopJobByRequest(rw http.ResponseWriter, r *http.Request) {
return return
} }
log.Printf("loading db job from request for stopJobByRequest... : jobId=%d, cluster=%v, startTime=%d", req.JobId, req.Cluster, req.StartTime) log.Printf("loading db job for stopJobByRequest... : stopJobApiRequest=%#v", req)
job, err = api.JobRepository.Find(req.JobId, req.Cluster, req.StartTime) job, err = api.JobRepository.Find(req.JobId, req.Cluster, req.StartTime)
if err != nil { if err != nil {

View File

@ -235,6 +235,9 @@ func (r *JobRepository) Find(
q = q.Where("job.start_time = ?", *startTime) q = q.Where("job.start_time = ?", *startTime)
} }
s, _, _ := q.ToSql()
log.Printf("trying to find db job with query: %s", s)
log.Debugf("Timer Find %s", time.Since(start)) log.Debugf("Timer Find %s", time.Since(start))
return scanJob(q.RunWith(r.stmtCache).QueryRow()) return scanJob(q.RunWith(r.stmtCache).QueryRow())
} }