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
|
Queue string
|
||||||
MQConnection *amqp.Connection
|
MQConnection *amqp.Connection
|
||||||
MQChannel *amqp.Channel
|
MQChannel *amqp.Channel
|
||||||
MQQueue *amqp.Queue
|
MQQueue amqp.Queue
|
||||||
MQDelivery <-chan amqp.Delivery
|
MQDelivery <-chan amqp.Delivery
|
||||||
isConnected bool
|
isConnected bool
|
||||||
}
|
}
|
||||||
|
@ -316,13 +316,13 @@ func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
|
|||||||
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Marshal(c)")
|
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Marshal(c)")
|
||||||
|
|
||||||
if clientIsAlive(c.FromUserID64) {
|
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.")
|
logOnError(err, "MQTGCmdWorker["+strconv.Itoa(id)+"] : Publishing message.")
|
||||||
for err != nil && clientIsAlive(c.FromUserID64) {
|
for err != nil && clientIsAlive(c.FromUserID64) {
|
||||||
clientsQueue[c.FromUserID64].Close()
|
clientsQueue[c.FromUserID64].Close()
|
||||||
time.Sleep(5 * time.Second)
|
time.Sleep(5 * time.Second)
|
||||||
clientsQueue[c.FromUserID64].Open()
|
clientsQueue[c.FromUserID64].Open()
|
||||||
err = clientsQueue[c.FromUserID64].Publish("application/json", j)
|
err = clientsQueue[c.FromUserID64].Publish("application/json", string(j))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
err = nil
|
err = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user