This commit is contained in:
shoopea 2019-06-28 18:32:53 +08:00
parent 52d3ba9cce
commit 6885975ea0

View File

@ -238,7 +238,7 @@ func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Marshal(c)") logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Marshal(c)")
//log.Printf("MQTGCmdWorker["+strconv.Itoa(id)+"] : new command.\n%s\n", string(j)) //log.Printf("MQTGCmdWorker["+strconv.Itoa(id)+"] : new command.\n%s\n", string(j))
for clientsQueue[c.FromUserID64].Connection.IsClosed() { for clientsQueue[c.FromUserID64].Connection.IsClosed() {
clientsQueue[c.FromUserID64].Connection, err = amqp.Dial("amqp://" + c.User + ":" + c.Password + "@" + c.Host + "/" + c.Path) clientsQueue[c.FromUserID64].Connection, err = amqp.Dial("amqp://" + clientsQueue[c.FromUserID64].User + ":" + clientsQueue[c.FromUserID64].Password + "@" + clientsQueue[c.FromUserID64].Host + "/" + clientsQueue[c.FromUserID64].Path)
logOnError(err, "MQKeepAliveWorker : Cannot open MQ connection") logOnError(err, "MQKeepAliveWorker : Cannot open MQ connection")
if err != nil { if err != nil {
clientsQueue[c.FromUserID64].Connection.Close() clientsQueue[c.FromUserID64].Connection.Close()