mirror of
https://github.com/coredns/coredns.git
synced 2026-01-12 03:41:18 -05:00
Refactor: Update the cache getter function (#7800)
Rename the cache getter function to reflect the true functionality of retrieving with TTL consideration. Refs: https://github.com/coredns/coredns/issues/6505 Signed-off-by: Raisa Kabir <raisa.kabir2010@gmail.com>
This commit is contained in:
4
plugin/cache/cache_test.go
vendored
4
plugin/cache/cache_test.go
vendored
@@ -295,7 +295,7 @@ func TestCacheInsertion(t *testing.T) {
|
||||
}
|
||||
|
||||
// Attempt to retrieve cache entry
|
||||
i := c.getIgnoreTTL(time.Now().UTC(), state, "dns://:53")
|
||||
i := c.getIfNotStale(time.Now().UTC(), state, "dns://:53")
|
||||
found := i != nil
|
||||
|
||||
if !tc.shouldCache && found {
|
||||
@@ -879,7 +879,7 @@ func TestCacheSeparation(t *testing.T) {
|
||||
m = cacheMsg(m, tc.query)
|
||||
state = request.Request{W: &test.ResponseWriter{}, Req: m}
|
||||
|
||||
item := c.getIgnoreTTL(time.Now().UTC(), state, "dns://:53")
|
||||
item := c.getIfNotStale(time.Now().UTC(), state, "dns://:53")
|
||||
found := item != nil
|
||||
|
||||
if !tc.expectCached && found {
|
||||
|
||||
Reference in New Issue
Block a user