aboutsummaryrefslogtreecommitdiffstats
path: root/cache/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'cache/cache.go')
-rw-r--r--cache/cache.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/cache/cache.go b/cache/cache.go
index f621611..326c285 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -160,8 +160,7 @@ func (c *Cache) refresh(key uint64, old *dns.Msg) {
c.mu.Lock()
defer c.mu.Unlock()
if canCache(r) {
- c.values[key].CreatedAt = c.now()
- c.values[key].msg = r
+ c.values[key] = &Value{CreatedAt: c.now(), msg: r}
} else {
c.evict(key)
}