test
This commit is contained in:
parent
05f7aa05f2
commit
b205f12a2e
10
workers.go
10
workers.go
@ -285,9 +285,9 @@ func MQKeepAliveWorker() {
|
||||
clt := MQClient{}
|
||||
clt.Connection, err = amqp.Dial("amqp://" + cfg.Rabbit.User + ":" + cfg.Rabbit.Password + "@" + cfg.Rabbit.Host + "/" + x.Queue)
|
||||
logOnError(err, "MQKeepAliveWorker : Failed to connect to RabbitMQ")
|
||||
clt.Channel, err = clt.conn.Channel()
|
||||
clt.Channel, err = clt.Connection.Channel()
|
||||
logOnError(err, "MQKeepAliveWorker : Failed to open a channel")
|
||||
clt.Queue, err = ch.QueueDeclare(
|
||||
clt.Queue, err = clt.Channel.QueueDeclare(
|
||||
"msg", // name
|
||||
false, // durable
|
||||
false, // delete when unused
|
||||
@ -325,9 +325,9 @@ func MQTidyKeepAliveWorker() {
|
||||
t := time.Now()
|
||||
for _, v := range clientsKeepAlive {
|
||||
if v.Date.Add(90 * time.Second).Before(time.Now()) {
|
||||
msgs, err := clt[v.UserID64].Channel.QueuePurge(clt[v.UserID64].Queue.Name, false)
|
||||
_ = clt[v.UserID64].Channel.Close()
|
||||
_ = clt[v.UserID64].Connection.Close()
|
||||
msgs, err := clientsQueue[v.UserID64].Channel.QueuePurge(clt[v.UserID64].Queue.Name, false)
|
||||
_ = clientsQueue[v.UserID64].Channel.Close()
|
||||
_ = clientsQueue[v.UserID64].Connection.Close()
|
||||
c := TGCommand{
|
||||
Type: commandSendMsg,
|
||||
ToUserID64: v.UserID64,
|
||||
|
Loading…
Reference in New Issue
Block a user