From ae5d619cfb8696d304587f8915b323fce6781019 Mon Sep 17 00:00:00 2001 From: shoopea Date: Fri, 10 May 2019 17:28:05 +0800 Subject: [PATCH] test --- def.go | 1 + sql.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/def.go b/def.go index 6658661..ef13bd8 100644 --- a/def.go +++ b/def.go @@ -115,6 +115,7 @@ const ( SQLCWMsgWorkers = 6 SQLIdentifyMsgWorkers = 6 SQLJobWorkers = 3 + SQLJobSliceSize = 25 ) var ( diff --git a/sql.go b/sql.go index d4655d3..611265e 100644 --- a/sql.go +++ b/sql.go @@ -1385,10 +1385,10 @@ func loadCurrentJobs() ([]Job, error) { } defer tx.Rollback() - stmt, err := tx.Prepare("SELECT o.id, o.obj_sub_type_id, j.payload FROM obj_job j, obj o WHERE j.obj_id = o.id AND j.status = ? AND j.schedule <= ? ORDER BY j.prio ASC LIMIT 10 FOR UPDATE;") + stmt, err := tx.Prepare("SELECT o.id, o.obj_sub_type_id, j.payload FROM obj_job j, obj o WHERE j.obj_id = o.id AND j.status = ? AND j.schedule <= ? ORDER BY j.prio ASC LIMIT ? FOR UPDATE;") logOnError(err, "loadCurrentJobs : prepare select statement") - rows, err := stmt.Query(objJobStatusNew, time.Now()) + rows, err := stmt.Query(objJobStatusNew, time.Now(), SQLJobSliceSize) logOnError(err, "loadCurrentJobs : query select statement") for rows.Next() {