refactor: Use LRU cache instead of redis cache
This commit is contained in:
parent
04374de9eb
commit
d88bd035d0
1 changed files with 2 additions and 4 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue