client revamping compilation fix
This commit is contained in:
parent
a46ba7699b
commit
6d58995d62
@ -101,7 +101,7 @@ func clientMsgGRolesAck(m *ChatWarsMessageGRolesAck) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func clientGetCWUserID64(tgUserID64 int64) (int64, error) {
|
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
|
i := clt.CWUserID64
|
||||||
clt.Mux.Unlock()
|
clt.Mux.Unlock()
|
||||||
return i, nil
|
return i, nil
|
||||||
|
4
utils.go
4
utils.go
@ -79,8 +79,8 @@ func toChatWarsDate(t time.Time) (s string, err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func RndInt64() int64 {
|
func RndInt64() int64 {
|
||||||
RndMu.Lock()
|
RndMux.Lock()
|
||||||
i := RndSrc.Int63()
|
i := RndSrc.Int63()
|
||||||
RndMu.Unlock()
|
RndMux.Unlock()
|
||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
|
@ -571,8 +571,8 @@ func MQTidyKeepAliveWorker() {
|
|||||||
t := time.Now()
|
t := time.Now()
|
||||||
muxClients.Lock()
|
muxClients.Lock()
|
||||||
for id, clt := range clients {
|
for id, clt := range clients {
|
||||||
if clt.Active && clt.Date.Add(3*KeepAliveHeartBeatSeconds*time.Second).Before(time.Now()) {
|
if clt.Active && clt.HeartBeat.Add(3*KeepAliveHeartBeatSeconds*time.Second).Before(time.Now()) {
|
||||||
msgs, err := clt.MQ.Channel.QueuePurge(c.MQ.Queue.Name, false)
|
msgs, err := clt.MQ.Channel.QueuePurge(clt.MQ.Queue.Name, false)
|
||||||
logOnError(err, "MQTidyKeepAliveWorker : Channel.QueuePurge()")
|
logOnError(err, "MQTidyKeepAliveWorker : Channel.QueuePurge()")
|
||||||
err = clt.MQ.Channel.Close()
|
err = clt.MQ.Channel.Close()
|
||||||
logOnError(err, "MQTidyKeepAliveWorker : Channel.Close()")
|
logOnError(err, "MQTidyKeepAliveWorker : Channel.Close()")
|
||||||
|
Loading…
Reference in New Issue
Block a user