Remove RRCache locking and clean up attributes

This commit is contained in:
Daniel 2020-09-30 17:16:45 +02:00
parent 7b5803482c
commit 7d9454f29a
3 changed files with 46 additions and 54 deletions

View file

@ -215,9 +215,7 @@ func checkCache(ctx context.Context, q *Query) *RRCache {
// Check if the cache will expire soon and start an async request.
if rrCache.ExpiresSoon() {
// Set flag that we are refreshing this entry.
rrCache.Lock()
rrCache.requestingNew = true
rrCache.Unlock()
rrCache.RequestingNew = true
log.Tracer(ctx).Tracef(
"resolver: cache for %s will expire in %s, refreshing async now",
@ -397,7 +395,7 @@ resolveLoop:
// Check if we want to use an older cache instead.
if oldCache != nil {
oldCache.isBackup = true
oldCache.IsBackup = true
switch {
case err != nil: