This commit is contained in:
shoopea 2019-06-28 15:23:44 +08:00
parent 80b4027776
commit b98069f4ba

View File

@ -62,6 +62,7 @@ func MQGetMsgWorker(id int, msgs chan<- ChatWarsMessage) {
msgs <- x
}
}
log.Printf("MQGetMsgWorker[" + strconv.Itoa(id) + "] : Closing queue.\n")
s.Close()
}
@ -91,6 +92,7 @@ func MQKeepAliveWorker() {
log.Printf("MQKeepAliveWorker : Session address : %p.\n", &s)
log.Printf("MQKeepAliveWorker : Connection address : %p.\n", &s.MQConnection)
log.Printf("MQKeepAliveWorker : Channel address : %p.\n", &s.MQChannel)
/*
q, err := s.MQChannel.QueueDeclare(
s.Queue, // name
false, // durable
@ -109,6 +111,8 @@ func MQKeepAliveWorker() {
false, // no-wait
nil, // args
)
for d := range m {
log.Printf("MQKeepAliveWorker : Received a message: %s", string(d.Body))
x := MQKeepAlive{}
@ -149,18 +153,13 @@ func MQKeepAliveWorker() {
TGCmdQueue <- c
clientSendCWMsg(x.UserID64, `🏅Me`)
/*
c = TGCommand{
Type: commandSendMsg,
FromUserID64: x.UserID64,
ToChatID64: userID64ChtWrsBot,
Text: `/hero`,
clientSendCWMsg(x.UserID64, `/hero`)
}
}
}
MQTGCmdQueue <- c
*/
}
}
}
s.Close()
log.Printf("MQKeepAliveWorker : Closing queue.\n")
}
log.Printf("MQKeepAliveWorker : Closing.")