Fix: mapping dns should not stale

This commit is contained in:
Dreamacro
2023-07-27 21:23:08 +08:00
parent 40bbd3dfdb
commit c1d027d6d1
2 changed files with 4 additions and 1 deletions

View File

@ -100,6 +100,9 @@ func withMapping(mapping *cache.LruCache) middleware {
continue
}
if ttl < 1 {
ttl = 1
}
mapping.SetWithExpire(ip.String(), host, time.Now().Add(time.Second*time.Duration(ttl)))
}