Skip to content

Commit

Permalink
fix: cache would never expire caused by #63 by accident
Browse files Browse the repository at this point in the history
  • Loading branch information
mzz2017 committed May 14, 2023
1 parent b991653 commit 717d86d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion control/dns_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (c *DnsController) LookupDnsRespCache(qname string, qtype dnsmessage.Type)
c.dnsCacheMu.Unlock()
// We should make sure the remaining TTL is greater than 120s (minFirefoxCacheTimeout), or
// return nil and request a new lookup to refresh the cache.
if ok {
if ok && cache.Deadline.After(time.Now()) {
return cache
}
return nil
Expand Down

0 comments on commit 717d86d

Please sign in to comment.