perf: use client cache for tables (#31102)
This commit is contained in:
parent
e3ce05b57e
commit
ba8cc6f9e4
2 changed files with 3 additions and 3 deletions
|
|
@ -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."""
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue