fix: drop Meta cache during update (#18182)

This commit is contained in:
Ankush Menat 2022-09-19 19:24:17 +05:30 committed by GitHub
parent 1c06b331ef
commit 656f6df257
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 2 deletions

View file

@ -56,7 +56,7 @@ DEFAULT_FIELD_LABELS = {
def get_meta(doctype, cached=True) -> "Meta":
if not cached:
if not cached or frappe.flags.in_patch:
return Meta(doctype)
if meta := frappe.cache().hget("meta", doctype):

View file

@ -211,5 +211,6 @@ frappe.patches.v14_0.set_suspend_email_queue_default
frappe.patches.v14_0.different_encryption_key
frappe.patches.v14_0.update_multistep_webforms
execute:frappe.delete_doc('Page', 'background_jobs', ignore_missing=True, force=True)
frappe.patches.v14_0.drop_meta_cache
frappe.patches.v14_0.drop_unused_indexes
frappe.patches.v15_0.drop_modified_index

View file

@ -0,0 +1,7 @@
import frappe
def execute():
cache = frappe.cache()
for key in cache.hkeys("meta"):
cache.hdel("meta", key)

View file

@ -74,7 +74,7 @@ class TestPerformance(FrappeTestCase):
"""Ideally should be ran against gunicorn worker, though I have not seen any difference
when using werkzeug's run_simple for synchronous requests."""
EXPECTED_RPS = 55 # measured on GHA
EXPECTED_RPS = 50 # measured on GHA
FAILURE_THREASHOLD = 0.1
req_count = 1000