Revert "test"

This reverts commit 3091ddb3a6.
This commit is contained in:
shoopea 2019-06-28 15:56:47 +08:00
parent df4727aff1
commit 5db39673b0
2 changed files with 3 additions and 3 deletions

2
def.go
View File

@ -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
} }

View File

@ -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", string(j)) err = clientsQueue[c.FromUserID64].Publish("application/json", 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", string(j)) err = clientsQueue[c.FromUserID64].Publish("application/json", j)
} }
} else { } else {
err = nil err = nil