更换cache使用方式

This commit is contained in:
zemal
2017-08-15 20:32:14 +08:00
parent 7d11a596e5
commit 0e96b7c2a8
7 changed files with 57 additions and 17 deletions

6
utils/cache.py Normal file
View File

@@ -0,0 +1,6 @@
from django.conf import settings
from django_redis import get_redis_connection
judge_queue_cache = get_redis_connection(settings.CACHE_JUDGE_QUEUE)
throttling_cache = get_redis_connection(settings.CACHE_THROTTLING)
default_cache = get_redis_connection("default")

2
utils/constants.py Normal file
View File

@@ -0,0 +1,2 @@
class CacheKey:
waiting_queue = "waiting_queue"