test
This commit is contained in:
parent
d71c8b32b8
commit
0da3fcf241
@ -236,7 +236,7 @@ func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
|
|||||||
if _, ok := clientsKeepAlive.Load(c.FromUserID64); ok {
|
if _, ok := clientsKeepAlive.Load(c.FromUserID64); ok {
|
||||||
j, err := json.Marshal(c)
|
j, err := json.Marshal(c)
|
||||||
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() {
|
||||||
log.Printf("MQKeepAliveWorker : Resetting MQ connection for #%d.\n", c.FromUserID64)
|
log.Printf("MQKeepAliveWorker : Resetting MQ connection for #%d.\n", c.FromUserID64)
|
||||||
clientsQueue[c.FromUserID64].Connection, err = amqp.Dial("amqp://" + clientsQueue[c.FromUserID64].User + ":" + clientsQueue[c.FromUserID64].Password + "@" + clientsQueue[c.FromUserID64].Host + "/" + clientsQueue[c.FromUserID64].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)
|
||||||
@ -283,7 +283,7 @@ func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
|
|||||||
Body: []byte(j),
|
Body: []byte(j),
|
||||||
})
|
})
|
||||||
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Publishing message.")
|
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Publishing message.")
|
||||||
log.Printf("MQTGCmdWorker[" + strconv.Itoa(id) + "] : Message published.")
|
//log.Printf("MQTGCmdWorker[" + strconv.Itoa(id) + "] : Message published.")
|
||||||
} else {
|
} else {
|
||||||
log.Printf("MQTGCmdWorker["+strconv.Itoa(id)+"] : client %d offline.\n", c.FromUserID64)
|
log.Printf("MQTGCmdWorker["+strconv.Itoa(id)+"] : client %d offline.\n", c.FromUserID64)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user