fix: Avoid doc caching if for_update is set (#22203)
* refactor: Avoid doc caching if for_update is set * chore: simplify condition --------- Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
This commit is contained in:
parent
fdcfb82f47
commit
db61deef72
1 changed files with 1 additions and 1 deletions
|
|
@ -1254,7 +1254,7 @@ def get_doc(*args, **kwargs):
|
|||
doc = frappe.model.document.get_doc(*args, **kwargs)
|
||||
|
||||
# Replace cache if stale one exists
|
||||
if (key := can_cache_doc(args)) and cache.exists(key):
|
||||
if not kwargs.get("for_update") and (key := can_cache_doc(args)) and cache.exists(key):
|
||||
_set_document_in_cache(key, doc)
|
||||
|
||||
return doc
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue