This commit is contained in:
shoopea 2019-05-16 20:41:21 +08:00
parent c7db99ce7d
commit 0d42524e6d

View File

@ -2,7 +2,9 @@ package main
import (
"encoding/json"
"fmt"
"log"
"math/rand"
"strconv"
"time"
@ -117,7 +119,7 @@ func SQLIdentifyMsgWorker(id int, objIds <-chan int64) {
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : insertMsgMiniWar")
err = setObjSubTypeId(objId, objSubTypeMessagePillageInc)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : setObjSubTypeId(PillageInc)")
err = createJob(objSubTypeJobPillage, objJobPriority, m.UserID64, time.Now().Add((25+rand.Intn(35))*time.Second))
err = createJob(objSubTypeJobPillage, objJobPriority, m.UserID64, time.Now().Add((25+rand.Intn(35))*time.Second), `{}`)
logOnError(err, "SQLIdentifyMsgWorker["+strconv.Itoa(id)+"] : createJob(JobPillage)")
s := TGCommand{
Type: commandSendMsg,
@ -209,7 +211,7 @@ func TGCmdWorker(id int, b *tb.Bot, cmds <-chan TGCommand) {
log.Printf("TGCmdWorker[" + strconv.Itoa(id) + "] : Closing.")
}
func MQTGCmdWorker(id int, msgs <-chan TGCommand) {
func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
log.Printf("MQTGCmdWorker[" + strconv.Itoa(id) + "] : Starting.")
for c := range cmds {
j, err := json.Marshal(c)