This commit is contained in:
shoopea 2019-06-14 11:31:33 +08:00
parent dc063c4896
commit 6a1e74bdc9
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ import (
)
func clientKeepAlive(k, v interface{}) bool {
clt := v.(MQKeepAlive)
clt := v.(*MQKeepAlive)
if clt.Date.Add(2 * KeepAliveHeartBeatSeconds * time.Second).Before(time.Now()) {
msgs, err := clientsQueue[clt.UserID64].Channel.QueuePurge(clientsQueue[clt.UserID64].Queue.Name, false)
logOnError(err, "clientKeepAlive : Channel.QueuePurge()")

View File

@ -385,7 +385,7 @@ func MQKeepAliveWorker() {
if x.Date.Add(10 * time.Second).Before(time.Now()) {
// outdated keep-alive coming from client
} else if v, ok := clientsKeepAlive.Load(x.UserID64); ok {
k := v.(MQKeepAlive)
k := v.(*MQKeepAlive)
k.Date = x.Date
} else {
clt := MQClient{}