Skip to content

Commit

Permalink
Ensure record deadline gets updated if it already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
brycekahle committed Apr 20, 2021
1 parent 9b07f26 commit afb69a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/network/dns_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@ type dnsCacheVal struct {
}

func (v *dnsCacheVal) merge(name string, deadline time.Time, maxSize int) (rejected bool) {
if _, ok := v.names[name]; ok {
if exp, ok := v.names[name]; ok {
if deadline.After(exp) {
v.names[name] = deadline
}
return false
}
if len(v.names) == maxSize {
Expand Down

0 comments on commit afb69a4

Please sign in to comment.