Skip to content

Commit

Permalink
moved defer without removing integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phillip-stephens committed May 23, 2024
1 parent b4744e2 commit c536f34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/zdns/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (s *Cache) AddCachedAnswer(answer interface{}, depth int) {
}
expiresAt := time.Now().Add(time.Duration(a.Ttl) * time.Second)
s.IterativeCache.Lock(q)
defer s.IterativeCache.Unlock(q)
// don't bother to move this to the top of the linked list. we're going
// to add this record back in momentarily and that will take care of this
i, ok := s.IterativeCache.GetNoMove(q)
Expand All @@ -82,7 +83,6 @@ func (s *Cache) AddCachedAnswer(answer interface{}, depth int) {
ca.Answers[a] = ta
s.IterativeCache.Add(q, ca)
s.VerboseLog(depth+1, "Add cached answer ", q, " ", ca)
s.IterativeCache.Unlock(q)
}

func (s *Cache) GetCachedResult(q Question, isAuthCheck bool, depth int) (SingleQueryResult, bool) {
Expand Down

0 comments on commit c536f34

Please sign in to comment.