test
This commit is contained in:
parent
d04287d63b
commit
b6444c33ab
4
bot.go
4
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))
|
||||
|
6
job.go
6
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)")
|
||||
|
Loading…
Reference in New Issue
Block a user