This commit is contained in:
shoopea 2019-05-25 20:00:47 +08:00
parent 67f8a0eec7
commit cd721708a8

5
sql.go
View File

@ -1638,10 +1638,11 @@ func loadCurrentJobs() ([]Job, error) {
}
defer tx.Rollback()
stmt, err := tx.Prepare("SELECT o.id, o.obj_sub_type_id, j.status, j.payload FROM obj_job j, obj o WHERE j.obj_id = o.id AND j.is_done = 0 and j.in_work = 0 AND j.schedule <= ? ORDER BY j.priority ASC, j.obj_id ASC LIMIT ? FOR UPDATE;")
stmt, err := tx.Prepare("SELECT o.id, o.obj_sub_type_id, j.status, j.payload FROM obj_job j, obj o WHERE j.obj_id = o.id AND j.is_done = 0 and j.in_work = 0 AND j.schedule <= ? ORDER BY j.priority ASC, j.obj_id ASC LIMIT 1 FOR UPDATE;")
logOnError(err, "loadCurrentJobs : prepare select statement")
rows, err := stmt.Query(time.Now(), SQLJobSliceSize)
//rows, err := stmt.Query(time.Now(), SQLJobSliceSize)
rows, err := stmt.Query(time.Now())
logOnError(err, "loadCurrentJobs : query select statement")
for rows.Next() {