def clean_cache(uid, to_uid, tid): backend.delete('topic:topic:%d' % tid) backend.delete('topic:replies:%d:1' % tid) backend.delete('topic:list:%d:1' % uid) backend.delete('topic:list:%d:1' % to_uid) backend.delete('topic:notify:%d' % to_uid) backend.delete('topic:meta:%d' % uid) backend.delete('topic:meta:%d' % to_uid) cross_cache.delete('open:account:unread:{0}'.format(to_uid))
def clear_user_cache(user): keys = ["account:%s" % key for key in [str(user.id), user.domain, user.email]] backend.delete_many(*keys) cross_cache.delete("open:account:info:{0}".format(user.id))