From 3a194f1705b2e56c04fbe868d9edf2c226e77975 Mon Sep 17 00:00:00 2001 From: radhitya Date: Mon, 6 Jul 2026 19:16:57 +0700 Subject: recursive mode --- internal/cache/cache.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/cache/cache.go') diff --git a/internal/cache/cache.go b/internal/cache/cache.go index 4d6b45c..b650ba1 100644 --- a/internal/cache/cache.go +++ b/internal/cache/cache.go @@ -8,7 +8,7 @@ import ( ) type Entry struct { - Msg *dns.Msg + Msg *dns.Msg Expires time.Time } @@ -17,7 +17,7 @@ func (e *Entry) expired() bool { } type Cache struct { - mu sync.RWMutex + mu sync.RWMutex data map[string]*Entry } @@ -67,7 +67,7 @@ func (c *Cache) Set(qname dns.Name, qtype, qclass uint16, msg *dns.Msg, ttl uint key := makeKey(qname, qtype, qclass) c.mu.Lock() c.data[key] = &Entry{ - Msg: msg, + Msg: msg, Expires: time.Now().Add(time.Duration(ttl) * time.Second), } c.mu.Unlock() -- cgit v1.2.3