perf: use client cache for tables (#31102)

This commit is contained in:
Ankush Menat 2025-02-04 15:00:59 +05:30 committed by GitHub
parent e3ce05b57e
commit ba8cc6f9e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -464,7 +464,7 @@ class Database:
@staticmethod
def clear_db_table_cache(query):
if query and is_query_type(query, ("drop", "create")):
frappe.cache.delete_key("db_tables")
frappe.client_cache.delete_value("db_tables")
def get_description(self):
"""Return result metadata."""

View file

@ -458,7 +458,7 @@ class MariaDBDatabase(MariaDBConnectionUtil, MariaDBExceptionUtil, Database):
to_query = not cached
if cached:
tables = frappe.cache.get_value("db_tables")
tables = frappe.client_cache.get_value("db_tables")
to_query = not tables
if to_query:
@ -470,7 +470,7 @@ class MariaDBDatabase(MariaDBConnectionUtil, MariaDBExceptionUtil, Database):
.where(information_schema.tables.table_schema == frappe.db.cur_db_name)
.run(pluck=True)
)
frappe.cache.set_value("db_tables", tables)
frappe.client_cache.set_value("db_tables", tables)
return tables