client revamping compilation fix

This commit is contained in:
shoopea 2019-07-31 14:41:48 +08:00
parent a46ba7699b
commit 6d58995d62
3 changed files with 5 additions and 5 deletions

View File

@ -101,7 +101,7 @@ func clientMsgGRolesAck(m *ChatWarsMessageGRolesAck) {
}
func clientGetCWUserID64(tgUserID64 int64) (int64, error) {
if clt, ok := getLockedClient(m.Msg.UserID64, false); ok {
if clt, ok := getLockedClient(tgUserID64, false); ok {
i := clt.CWUserID64
clt.Mux.Unlock()
return i, nil

View File

@ -79,8 +79,8 @@ func toChatWarsDate(t time.Time) (s string, err error) {
}
func RndInt64() int64 {
RndMu.Lock()
RndMux.Lock()
i := RndSrc.Int63()
RndMu.Unlock()
RndMux.Unlock()
return i
}

View File

@ -571,8 +571,8 @@ func MQTidyKeepAliveWorker() {
t := time.Now()
muxClients.Lock()
for id, clt := range clients {
if clt.Active && clt.Date.Add(3*KeepAliveHeartBeatSeconds*time.Second).Before(time.Now()) {
msgs, err := clt.MQ.Channel.QueuePurge(c.MQ.Queue.Name, false)
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()")
err = clt.MQ.Channel.Close()
logOnError(err, "MQTidyKeepAliveWorker : Channel.Close()")