test callbacks

This commit is contained in:
shoopea 2020-02-05 09:50:06 +08:00
parent 7a10cf1af0
commit 05a65dd0f3

View File

@ -313,6 +313,11 @@ func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
func SQLCWMsgWorker(id int, msgs <-chan ChatWarsMessage, objIds chan<- int64) { func SQLCWMsgWorker(id int, msgs <-chan ChatWarsMessage, objIds chan<- int64) {
//log.Printf("SQLCWMsgWorker[" + strconv.Itoa(id) + "] : Starting.") //log.Printf("SQLCWMsgWorker[" + strconv.Itoa(id) + "] : Starting.")
for m := range msgs { for m := range msgs {
if len(m.Callbacks) != 0 {
for c := range m.Callbacks {
log.Printf("SQLCWMsgWorker[%d] (%d) : Callback : %s : %s\n", id, m.ID64, c.name, string(c.data))
}
}
objId, err := addObjMsg(m.ID64, m.ChatID64, m.TGUserID64, m.TGSenderUserID64, m.Date, m.Text) objId, err := addObjMsg(m.ID64, m.ChatID64, m.TGUserID64, m.TGSenderUserID64, m.Date, m.Text)
logOnError(err, "SQLCWMsgWorker["+strconv.Itoa(id)+"] : Inserting message.") logOnError(err, "SQLCWMsgWorker["+strconv.Itoa(id)+"] : Inserting message.")
if err == nil && objId != 0 { if err == nil && objId != 0 {