From 72a824f483b4e1dd82975635b17d27c3888eb292 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 13 Jul 2012 08:14:32 +0530 Subject: [PATCH 1/2] do not delete web cache in refresh cache --- erpnext/website/web_cache.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/erpnext/website/web_cache.py b/erpnext/website/web_cache.py index 01c8e2d6029..141c83f6ad6 100644 --- a/erpnext/website/web_cache.py +++ b/erpnext/website/web_cache.py @@ -223,7 +223,7 @@ def refresh_cache(build=None): """delete and re-create web cache entries""" import webnotes - webnotes.conn.sql("delete from `tabWeb Cache`") + # webnotes.conn.sql("delete from `tabWeb Cache`") query_map = { 'Web Page': """select page_name, name from `tabWeb Page` where docstatus=0""", @@ -239,9 +239,8 @@ def refresh_cache(build=None): for result in webnotes.conn.sql(query_map[dt], as_dict=1): create_cache(result['page_name'], dt, result['name']) clear_cache(result['page_name'], dt, result['name']) - if build and dt in build: load_into_cache(result['page_name']) for page_name in get_predefined_pages(): create_cache(page_name, None, None) clear_cache(page_name, None, None) - if build: load_into_cache(page_name) + if build: load_into_cache(page_name) \ No newline at end of file From 665f6048f15a56ed801be0ff171e274f1a8d095f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 13 Jul 2012 08:15:03 +0530 Subject: [PATCH 2/2] do not delete web cache in refresh cache --- erpnext/website/web_cache.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/website/web_cache.py b/erpnext/website/web_cache.py index 141c83f6ad6..8da38e5a144 100644 --- a/erpnext/website/web_cache.py +++ b/erpnext/website/web_cache.py @@ -239,6 +239,7 @@ def refresh_cache(build=None): for result in webnotes.conn.sql(query_map[dt], as_dict=1): create_cache(result['page_name'], dt, result['name']) clear_cache(result['page_name'], dt, result['name']) + if build and dt in build: load_into_cache(result['page_name']) for page_name in get_predefined_pages(): create_cache(page_name, None, None)