mirror of https://github.com/Dreamacro/clash.git
Fix: mapping dns should not stale
This commit is contained in:
parent
40bbd3dfdb
commit
c1d027d6d1
|
@ -78,7 +78,7 @@ func NewEnhancer(cfg Config) *ResolverEnhancer {
|
|||
|
||||
if cfg.EnhancedMode != C.DNSNormal {
|
||||
fakePool = cfg.Pool
|
||||
mapping = cache.New(cache.WithSize(4096), cache.WithStale(true))
|
||||
mapping = cache.New(cache.WithSize(4096))
|
||||
}
|
||||
|
||||
return &ResolverEnhancer{
|
||||
|
|
|
@ -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)))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue