debug client revamping
This commit is contained in:
parent
30e621c539
commit
aca10f53a8
@ -160,17 +160,17 @@ func MQKeepAliveWorker() {
|
|||||||
err = json.Unmarshal(d.Body, &x)
|
err = json.Unmarshal(d.Body, &x)
|
||||||
logOnError(err, "MQKeepAliveWorker : Can't unmarshal.\n"+string(d.Body))
|
logOnError(err, "MQKeepAliveWorker : Can't unmarshal.\n"+string(d.Body))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Printf("MQKeepAliveWorker : Received message from %s", x.Nickname)
|
log.Printf("MQKeepAliveWorker : Received message from %s (%d).\n", x.Nickname, x.TGUserID64)
|
||||||
if x.Date.Add(10 * time.Second).Before(time.Now()) {
|
if x.Date.Add(10 * time.Second).Before(time.Now()) {
|
||||||
// outdated keep-alive coming from client
|
// outdated keep-alive coming from client
|
||||||
} else if clt, ok := getLockedClient(x.TGUserID64, true); ok {
|
} else if clt, ok := getLockedClient(x.TGUserID64, true); ok {
|
||||||
clt.HeartBeat = x.Date
|
clt.HeartBeat = x.Date
|
||||||
if clt.Active {
|
if clt.Active {
|
||||||
log.Printf("MQKeepAliveWorker : Client %s already active.\n", clt.Login)
|
log.Printf("MQKeepAliveWorker : Client %s (%d) already active.\n", clt.Login, clt.TGUserID64)
|
||||||
clt.Mux.Unlock()
|
clt.Mux.Unlock()
|
||||||
} else {
|
} else {
|
||||||
clt.Login = x.Nickname
|
clt.Login = x.Nickname
|
||||||
log.Printf("MQKeepAliveWorker : Connecting to %s.\n", clt.Login)
|
log.Printf("MQKeepAliveWorker : Connecting to %s (%d).\n", clt.Login, clt.TGUserID64)
|
||||||
clt.MQ.User = cfg.Rabbit.User
|
clt.MQ.User = cfg.Rabbit.User
|
||||||
clt.MQ.Password = cfg.Rabbit.Password
|
clt.MQ.Password = cfg.Rabbit.Password
|
||||||
clt.MQ.Host = cfg.Rabbit.Host
|
clt.MQ.Host = cfg.Rabbit.Host
|
||||||
|
Loading…
Reference in New Issue
Block a user