parent
df4727aff1
commit
5db39673b0
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", string(j))
|
||||
err = clientsQueue[c.FromUserID64].Publish("application/json", 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", string(j))
|
||||
err = clientsQueue[c.FromUserID64].Publish("application/json", j)
|
||||
}
|
||||
} else {
|
||||
err = nil
|
||||
|
Loading…
Reference in New Issue
Block a user