fix: 请求的缓存结果移动并复用

This commit is contained in:
spiritlhl committed 2025-04-11 14:15:20 +00:00
1 parent 0c7727e3dc
commit 211c724509
3 files changed
+24 -27

No files matched your search

+7
View File
@@ -8,6 +8,13 @@ import (
)
func BackTrace(enableIpv6 bool) {
if model.CachedIcmpData == "" || model.ParsedIcmpTargets == nil || time.Since(model.CachedIcmpDataFetchTime) > time.Hour {
model.CachedIcmpData = getData(model.IcmpTargets)
model.CachedIcmpDataFetchTime = time.Now()
if model.CachedIcmpData != "" {
model.ParsedIcmpTargets = parseIcmpTargets(model.CachedIcmpData)
}
}
if enableIpv6 {
ipv4Count := len(model.Ipv4s)
ipv6Count := len(model.Ipv6s)