This commit is contained in:
shoopea 2019-05-11 13:20:44 +08:00
parent d04287d63b
commit b6444c33ab
2 changed files with 6 additions and 4 deletions

4
bot.go
View File

@ -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))

6
job.go
View File

@ -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)")