mirror of
https://github.com/daeuniverse/dae.git
synced 2025-01-03 13:31:00 +07:00
parent
11d792e6a9
commit
e0d3cb0ecd
@ -134,9 +134,9 @@ func (c *DnsController) LookupDnsRespCache(qname string, qtype dnsmessage.Type)
|
|||||||
c.dnsCacheMu.Lock()
|
c.dnsCacheMu.Lock()
|
||||||
cache, ok := c.dnsCache[c.cacheKey(qname, qtype)]
|
cache, ok := c.dnsCache[c.cacheKey(qname, qtype)]
|
||||||
c.dnsCacheMu.Unlock()
|
c.dnsCacheMu.Unlock()
|
||||||
// We should make sure the remaining TTL is greater than 120s (minFirefoxCacheTimeout), or
|
// We should make sure the cache did not expire, or
|
||||||
// return nil and request a new lookup to refresh the cache.
|
// return nil and request a new lookup to refresh the cache.
|
||||||
if ok {
|
if ok && cache.Deadline.After(time.Now()) {
|
||||||
return cache
|
return cache
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user