This works but doubles up on the number of functions needed. But by
calling cache.ram directly I'm able to define a lambda function that
uses the 'searchText' parameter. can anyone take this one step
further?
def search_user_contacts_cached(searchText):
from applications.init.modules.user import User
user = User(globals())
contacts = user.find_contacts(searchText)
return searchText, contacts
@service.jsonrpc
def search_user_contacts(searchText):
return cache.ram('search_contact=%s'%searchText,
lambda: search_user_contacts_cached(searchText),
60)