test
This commit is contained in:
parent
3957c8fe3c
commit
3091ddb3a6
2
def.go
2
def.go
@ -28,7 +28,7 @@ type MQSession struct {
|
||||
Queue string
|
||||
MQConnection *amqp.Connection
|
||||
MQChannel *amqp.Channel
|
||||
MQQueue *amqp.Queue
|
||||
MQQueue amqp.Queue
|
||||
MQDelivery <-chan amqp.Delivery
|
||||
isConnected bool
|
||||
}
|
||||
|
@ -316,13 +316,13 @@ func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
|
||||
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Marshal(c)")
|
||||
|
||||
if clientIsAlive(c.FromUserID64) {
|
||||
err = clientsQueue[c.FromUserID64].Publish("application/json", j)
|
||||
err = clientsQueue[c.FromUserID64].Publish("application/json", string(j))
|
||||
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Publishing message.")
|
||||
for err != nil && clientIsAlive(c.FromUserID64) {
|
||||
clientsQueue[c.FromUserID64].Close()
|
||||
time.Sleep(5 * time.Second)
|
||||
clientsQueue[c.FromUserID64].Open()
|
||||
err = clientsQueue[c.FromUserID64].Publish("application/json", j)
|
||||
err = clientsQueue[c.FromUserID64].Publish("application/json", string(j))
|
||||
}
|
||||
} else {
|
||||
err = nil
|
||||
|
Loading…
Reference in New Issue
Block a user