[VAULT-4034] Revert back to caching nil values (#13013)

* Revert "[VAULT-4034] Only cache non-nil values (#12993)"

This reverts commit 67e1ed06c7.

* Update sdk/physical/cache.go

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>

Co-authored-by: Nick Cabatoff <ncabatoff@hashicorp.com>
This commit is contained in:
Pratyoy Mukhopadhyay
2021-11-02 12:00:37 -07:00
committed by GitHub
parent 98421bb68c
commit fa03adb718
3 changed files with 2 additions and 49 deletions

View File

@@ -184,10 +184,8 @@ func (c *Cache) Get(ctx context.Context, key string) (*Entry, error) {
return nil, err
}
if ent != nil {
// Cache the result
c.lru.Add(key, ent)
}
// Cache the result, even if nil
c.lru.Add(key, ent)
return ent, nil
}