feat: don't rebuild count cache on every insert
This commit is contained in:
parent
c41d10e553
commit
aca5bdb89f
2 changed files with 2 additions and 12 deletions
|
|
@ -121,7 +121,7 @@ def clear_doctype_map(doctype, name):
|
|||
cache_key = frappe.scrub(doctype) + '_map'
|
||||
frappe.cache().hdel(cache_key, name)
|
||||
|
||||
def build_table_count_cache(doc=None, method=None, *args, **kwargs):
|
||||
def build_table_count_cache():
|
||||
if (frappe.flags.in_patch
|
||||
or frappe.flags.in_install
|
||||
or frappe.flags.in_migrate
|
||||
|
|
@ -129,15 +129,6 @@ def build_table_count_cache(doc=None, method=None, *args, **kwargs):
|
|||
or frappe.flags.in_setup_wizard):
|
||||
return
|
||||
|
||||
if doc and isinstance(doc, Document):
|
||||
doctype = doc.doctype
|
||||
|
||||
if doc.meta.istable:
|
||||
return
|
||||
|
||||
if doctype in count_cache_blacklist:
|
||||
return
|
||||
|
||||
_cache = frappe.cache()
|
||||
data = frappe.db.multisql({
|
||||
"mariadb": """
|
||||
|
|
|
|||
|
|
@ -143,8 +143,7 @@ doc_events = {
|
|||
],
|
||||
"on_change": [
|
||||
"frappe.social.doctype.energy_point_rule.energy_point_rule.process_energy_points"
|
||||
],
|
||||
"after_insert": "frappe.cache_manager.build_table_count_cache"
|
||||
]
|
||||
},
|
||||
"Event": {
|
||||
"after_insert": "frappe.integrations.doctype.google_calendar.google_calendar.insert_event_in_google_calendar",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue