From bd53a169cc98f8e7fa0cabd0d76ea28e37f33cec Mon Sep 17 00:00:00 2001 From: lwch Date: Thu, 19 Aug 2021 12:15:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/server/handler/client.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/server/handler/client.go b/code/server/handler/client.go index 1be6ca8..0d46142 100644 --- a/code/server/handler/client.go +++ b/code/server/handler/client.go @@ -31,6 +31,13 @@ func newClient(parent *Handler, id string, conn *network.Conn) *client { func (c *client) run() { for { if time.Since(c.updated).Seconds() > 600 { + links := make([]string, 0, len(c.links)) + c.RLock() + for id := range c.links { + links = append(links, id) + } + c.RUnlock() + logging.Info("%s is not keepalived, links: %v", c.id, links) c.parent.closeAll(c) return }