avoid fetching ip continuously (#89)

This commit is contained in:
UUBulb 2024-11-23 22:00:14 +08:00 committed by GitHub
parent a551154b96
commit ee37e35eb2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -492,9 +492,8 @@ func reportState(statClient pb.NezhaService_ReportSystemStateClient, host, ip ti
}
// 更新IP信息
if time.Since(ip) > time.Second*time.Duration(agentConfig.IPReportPeriod) {
if reportGeoIP(agentConfig.UseIPv6CountryCode) {
ip = time.Now()
}
reportGeoIP(agentConfig.UseIPv6CountryCode)
ip = time.Now()
}
return host, ip, nil
}