fix: Wild card cache clearing for doctypes (#31415)
Clear all keys that contain doctype name. This is just a hack to avoid dealing with many random partial caches that exist. Possible improvement: - Standardize ALL doctype specific cache keys so this becomes simple.
This commit is contained in:
parent
55ad9c9c94
commit
dc5bbc15ce
1 changed files with 3 additions and 0 deletions
|
|
@ -139,6 +139,9 @@ def _clear_doctype_cache_from_redis(doctype: str | None = None):
|
|||
|
||||
def clear_single(dt):
|
||||
frappe.clear_document_cache(dt)
|
||||
# Wild card for all keys containing this doctype.
|
||||
# this can be excessive but this function isn't called often... ideally.
|
||||
frappe.client_cache.delete_keys(f"*{dt}*")
|
||||
frappe.cache.hdel_names(doctype_cache_keys, dt)
|
||||
clear_meta_cache(dt)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue