From d88bd035d02c7416c3e0c6d4985ae89a778e4acd Mon Sep 17 00:00:00 2001 From: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com> Date: Fri, 22 Oct 2021 09:29:15 +0530 Subject: [PATCH] refactor: Use LRU cache instead of redis cache --- .../print_format_builder_beta/print_format_builder_beta.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/frappe/printing/page/print_format_builder_beta/print_format_builder_beta.py b/frappe/printing/page/print_format_builder_beta/print_format_builder_beta.py index 6ef4395958..2ce5531785 100644 --- a/frappe/printing/page/print_format_builder_beta/print_format_builder_beta.py +++ b/frappe/printing/page/print_format_builder_beta/print_format_builder_beta.py @@ -3,13 +3,11 @@ from __future__ import unicode_literals import frappe +import functools @frappe.whitelist() +@functools.lru_cache() def get_google_fonts(): - return frappe.cache().get_value("google_fonts", generator=_get_google_fonts) - - -def _get_google_fonts(): file_path = frappe.get_app_path("frappe", "data", "google_fonts.json") return frappe.parse_json(frappe.read_file(file_path))