tornado: Cache messages internally in tornado process.

This allows us to handle the return_messages_immediately part of
get_updates requests without having to talk to the database.

(imported from commit ed0b7742d359efb21a0a4960f4fc25f4337e9ad4)
This commit is contained in:
Tim Abbott
2013-01-09 14:35:19 -05:00
parent 7e62ef5a03
commit a058471a56
4 changed files with 90 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
from functools import wraps
import django.core.cache
from django.core.cache import cache as djcache
def cache_with_key(keyfunc):
"""Decorator which applies Django caching to a function.
@@ -11,8 +11,6 @@ def cache_with_key(keyfunc):
other uses of caching."""
def decorator(func):
djcache = django.core.cache.cache
@wraps(func)
def func_with_caching(*args, **kwargs):
key = keyfunc(*args, **kwargs)