From 5f708fa160ef9df5553aca0eb7292539ccb07cac Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 11 Dec 2020 12:47:16 +0530 Subject: [PATCH] feat: cache bench apps --- frappe/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frappe/__init__.py b/frappe/__init__.py index c5f13f2295..2bab1cd294 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -348,7 +348,7 @@ def msgprint(msg, title=None, raise_exception=0, as_table=False, as_list=False, if as_table and type(msg) in (list, tuple): out.as_table = 1 - + if as_list and type(msg) in (list, tuple) and len(msg) > 1: out.as_list = 1 @@ -939,7 +939,11 @@ def get_installed_apps(sort=False, frappe_last=False): connect() if not local.all_apps: - local.all_apps = get_all_apps(True) + local.all_apps = cache().get_value('all_apps', get_all_apps) + + #cache bench apps + if not cache().get_value('all_apps'): + cache().set_value('all_apps', local.all_apps) installed = json.loads(db.get_global("installed_apps") or "[]")