This commit is contained in:
shoopea 2019-05-11 11:19:45 +08:00
parent cd2ee8d3b9
commit c25a02be3e

5
bot.go
View File

@ -5,7 +5,6 @@ import (
"fmt"
tb "gopkg.in/tucnak/telebot.v2"
"regexp"
"strconv"
"time"
)
@ -96,7 +95,7 @@ func botMsgRescan(m *tb.Message) (string, error) {
r := regexp.MustCompile("^[0-9]+$")
if r.MatchString(m.Payload) {
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;", m.Payload, objTypeMessage, objSubTypeMessageUnprocessed)
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;", m.Payload, objTypeMessage, objSubTypeMessageUnknown)
b, _ := json.Marshal(p)
err := createJob(objSubTypeJobRescanMsg, 2, time.Now(), b)
logOnError(err, "botMsgRescan : createJob(objSubTypeJobRescanMsg)")
@ -110,7 +109,7 @@ func botMsgRescan(m *tb.Message) (string, error) {
r = regexp.MustCompile("^all$")
if r.MatchString(m.Payload) {
p := JobPayloadRescanMsg{}
fmt.Sprintf(p.Query, "SELECT o.id from obj o where o.obj_type_id = %d and o.obj_sub_type_id = %d;", objTypeMessage, objSubTypeMessageUnprocessed)
fmt.Sprintf(p.Query, "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)
err := createJob(objSubTypeJobRescanMsg, 3, time.Now(), b)
logOnError(err, "botMsgRescan : createJob(objSubTypeJobRescanMsg)")