mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 22:19:48 +00:00
Extract data from cache in tornado_callbacks with cache_get_many
This reduces the number of memcached calls we make in our time- slice-limited tornado event handler. (imported from commit 8903ce4ac754ba82d57e04d1b0356be7533edee2)
This commit is contained in:
@@ -233,6 +233,9 @@ def user_profile_by_email_cache_key(email):
|
||||
def user_profile_by_id_cache_key(user_profile_id):
|
||||
return "user_profile_by_id:%s" % (user_profile_id,)
|
||||
|
||||
def cache_save_user_profile(user_profile):
|
||||
cache_set(user_profile_by_id_cache_key(user_profile.id), user_profile, timeout=3600*24*7)
|
||||
|
||||
# Called by models.py to flush the user_profile cache whenever we save
|
||||
# a user_profile object
|
||||
def update_user_profile_cache(sender, **kwargs):
|
||||
|
||||
Reference in New Issue
Block a user