From f41ef6b0fa07bf329a5bebad6d0291da3e9388cc Mon Sep 17 00:00:00 2001 From: yuzuki999 Date: Fri, 19 Aug 2022 22:55:47 +0800 Subject: [PATCH] fix ip report bug --- node/node.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/node/node.go b/node/node.go index 8073378..f28eb95 100644 --- a/node/node.go +++ b/node/node.go @@ -113,13 +113,13 @@ func (c *Node) Start() error { Interval: time.Duration(c.config.IpRecorderConfig.Periodic) * time.Second, Execute: c.onlineIpReport, } + go func() { + time.Sleep(time.Duration(c.config.UpdatePeriodic) * time.Second) + _ = c.onlineIpReportPeriodic.Start() + }() + log.Printf("[%s: %d] Start report online ip", c.nodeInfo.NodeType, c.nodeInfo.NodeId) } - log.Printf("[%s: %d] Start report online ip", c.nodeInfo.NodeType, c.nodeInfo.NodeId) // delay to start onlineIpReport - go func() { - time.Sleep(time.Duration(c.config.UpdatePeriodic) * time.Second) - _ = c.onlineIpReportPeriodic.Start() - }() runtime.GC() return nil }