fix: Don't cache anything hashable

If filters are list or dict then they aren't hashable, there was little
reason to do this IMO.

If something is indeed cacheable then where is the eviction for it?
simple k:v is only thing we can realistically cache here.
This commit is contained in:
Ankush Menat 2024-12-16 13:17:09 +05:30
parent 9fd891d01e
commit eaa6e4003a

View file

@ -595,7 +595,7 @@ class Database:
"""
out = None
cache_key = None
if cache and isinstance(filters, Hashable):
if cache and isinstance(filters, str):
cache_key = (doctype, filters, fieldname)
if cache_key in self.value_cache:
return self.value_cache[cache_key]