mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 05:19:05 +01:00
change logging key, add args, add orderby id job.Find()
This commit is contained in:
parent
597ee1dad7
commit
c120d6517f
@ -929,7 +929,7 @@ func (api *RestApi) stopJobByRequest(rw http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("loading db job for stopJobByRequest... : stopJobApiRequest=%#v", req)
|
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 {
|
||||||
|
@ -235,8 +235,10 @@ func (r *JobRepository) Find(
|
|||||||
q = q.Where("job.start_time = ?", *startTime)
|
q = q.Where("job.start_time = ?", *startTime)
|
||||||
}
|
}
|
||||||
|
|
||||||
s, _, _ := q.ToSql()
|
q = q.OrderBy("job.id DESC") // always use newest matching job by db id
|
||||||
log.Printf("trying to find db job with query: %s", s)
|
|
||||||
|
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))
|
log.Debugf("Timer Find %s", time.Since(start))
|
||||||
return scanJob(q.RunWith(r.stmtCache).QueryRow())
|
return scanJob(q.RunWith(r.stmtCache).QueryRow())
|
||||||
|
Loading…
Reference in New Issue
Block a user