mirror of
https://github.com/oneclickvirt/backtrace.git
synced 2026-11-24 23:39:41 +08:00
fix: 请求的缓存结果移动并复用
This commit is contained in:
1 parent
0c7727e3dc
commit
211c724509
3 files changed
+24
-27
No files matched your search
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user