From b6444c33abb64a24800066571093688838ab3185 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 11 May 2019 13:20:44 +0800 Subject: [PATCH] test --- bot.go | 4 ++-- job.go | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bot.go b/bot.go index 794da20..fb894d3 100644 --- a/bot.go +++ b/bot.go @@ -77,7 +77,7 @@ func botMsgRescan(m *tb.Message) (string, error) { r := regexp.MustCompile("^[0-9]+$") if r.MatchString(m.Payload) { p := JobPayloadRescanMsg{ - Query: fmt.Sprintf("SELECT o.id from obj o where o.id = %s and o.obj_type_id = %d and o.obj_sub_type_id = %d;", m.Payload, objTypeMessage, objSubTypeMessageUnknown), + Query: fmt.Sprintf("SELECT o.id FROM obj o WHERE o.id = %s AND o.obj_type_id = %d AND o.obj_sub_type_id = %d;", m.Payload, objTypeMessage, objSubTypeMessageUnknown), } b, _ := json.Marshal(p) log.Printf("botMsgRescan : json : %s\n", string(b)) @@ -93,7 +93,7 @@ func botMsgRescan(m *tb.Message) (string, error) { r = regexp.MustCompile("^all$") if r.MatchString(m.Payload) { p := JobPayloadRescanMsg{ - Query: fmt.Sprintf("SELECT o.id from obj o where o.obj_type_id = %d and o.obj_sub_type_id = %d;", objTypeMessage, objSubTypeMessageUnknown), + Query: fmt.Sprintf("SELECT o.id FROM obj o WHERE o.obj_type_id = %d AND o.obj_sub_type_id = %d;", objTypeMessage, objSubTypeMessageUnknown), } b, _ := json.Marshal(p) log.Printf("botMsgRescan : json : %s\n", string(b)) diff --git a/job.go b/job.go index 6a27a70..5f88c56 100644 --- a/job.go +++ b/job.go @@ -19,8 +19,10 @@ func jobRescan(j Job) { if len(ids) > 1 { for _, id := range ids { - p := JobPayloadRescanMsg{} - fmt.Sprintf(p.Query, "SELECT o.id from obj o where o.id = %d and o.obj_type_id = %d and o.obj_sub_type_id = %d;", id, objTypeMessage, objSubTypeMessageUnknown) + p := JobPayloadRescanMsg{ + Query: fmt.Sprintf("SELECT o.id FROM obj o WHERE o.id = %d AND o.obj_type_id = %d AND o.obj_sub_type_id = %d;", id, objTypeMessage, objSubTypeMessageUnknown), + } + b, _ := json.Marshal(p) err := createJob(objSubTypeJobRescanMsg, objJobPriorityRescanChildMsg, time.Now(), b) logOnError(err, "jobRescan : createJob(objSubTypeJobRescanMsg)")