client revamping race condition
This commit is contained in:
parent
d7bcdb0108
commit
74b6b141f0
@ -571,6 +571,7 @@ func MQTidyKeepAliveWorker() {
|
||||
t := time.Now()
|
||||
muxClients.Lock()
|
||||
for id, clt := range clients {
|
||||
clt.Mux.Lock()
|
||||
if clt.Active && clt.HeartBeat.Add(3*KeepAliveHeartBeatSeconds*time.Second).Before(time.Now()) {
|
||||
msgs, err := clt.MQ.Channel.QueuePurge(clt.MQ.Queue.Name, false)
|
||||
logOnError(err, "MQTidyKeepAliveWorker : Channel.QueuePurge()")
|
||||
@ -592,6 +593,7 @@ func MQTidyKeepAliveWorker() {
|
||||
TGCmdQueue <- cmd
|
||||
clt.Active = false
|
||||
}
|
||||
clt.Mux.Unlock()
|
||||
}
|
||||
muxClients.Unlock()
|
||||
time.Sleep(time.Until(t.Add(time.Second)))
|
||||
|
Loading…
Reference in New Issue
Block a user