update
This commit is contained in:
parent
840b02287d
commit
9b842f347d
@ -41,8 +41,7 @@ func MQGetMsgWorker(id int, msgs chan<- ChatWarsMessage) {
|
|||||||
failOnError(err, "MQGetMsgWorker["+strconv.Itoa(id)+"] : Failed to register a consumer")
|
failOnError(err, "MQGetMsgWorker["+strconv.Itoa(id)+"] : Failed to register a consumer")
|
||||||
|
|
||||||
for d := range m {
|
for d := range m {
|
||||||
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Received a message: %s", string(d.Body))
|
// log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Received a message: %s", string(d.Body))
|
||||||
|
|
||||||
err = json.Unmarshal(d.Body, &x)
|
err = json.Unmarshal(d.Body, &x)
|
||||||
logOnError(err, "MQGetMsgWorker["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+string(d.Body))
|
logOnError(err, "MQGetMsgWorker["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+string(d.Body))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@ -60,7 +59,7 @@ func SQLCWMsgWorker(id int, msgs <-chan ChatWarsMessage, objIds chan<- int64) {
|
|||||||
objId, err := putUnprocessedMsg(m)
|
objId, err := putUnprocessedMsg(m)
|
||||||
logOnError(err, "SQLCWMsgWorker["+strconv.Itoa(id)+"] : Inserting message.")
|
logOnError(err, "SQLCWMsgWorker["+strconv.Itoa(id)+"] : Inserting message.")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Printf("SQLCWMsgWorker["+strconv.Itoa(id)+"] : Message inserted (%d).\n", objId)
|
// log.Printf("SQLCWMsgWorker["+strconv.Itoa(id)+"] : Message inserted (%d).\n", objId)
|
||||||
objIds <- objId
|
objIds <- objId
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,7 +129,7 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
|
|||||||
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : fromChatWarsDate")
|
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : fromChatWarsDate")
|
||||||
log.Println(t)
|
log.Println(t)
|
||||||
default:
|
default:
|
||||||
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Unknwon message type in rule %d : %d (%d)\n", msgParsingRules[i].ID, msgParsingRules[i].MsgTypeID, objId)
|
log.Printf("SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : Unknwon message type in rule %d : %d (%d)\n%s\n", msgParsingRules[i].ID, msgParsingRules[i].MsgTypeID, objId, m.Text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user