avoid fetching ip continuously (#89)
This commit is contained in:
parent
a551154b96
commit
ee37e35eb2
@ -492,10 +492,9 @@ func reportState(statClient pb.NezhaService_ReportSystemStateClient, host, ip ti
|
|||||||
}
|
}
|
||||||
// 更新IP信息
|
// 更新IP信息
|
||||||
if time.Since(ip) > time.Second*time.Duration(agentConfig.IPReportPeriod) {
|
if time.Since(ip) > time.Second*time.Duration(agentConfig.IPReportPeriod) {
|
||||||
if reportGeoIP(agentConfig.UseIPv6CountryCode) {
|
reportGeoIP(agentConfig.UseIPv6CountryCode)
|
||||||
ip = time.Now()
|
ip = time.Now()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return host, ip, nil
|
return host, ip, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user