Change cache to memcached
This commit is contained in:
parent
2e28b92759
commit
77e64f1b85
2 changed files with 3 additions and 3 deletions
|
@ -39,7 +39,7 @@ def user_completed_ids(profile):
|
||||||
if result is None:
|
if result is None:
|
||||||
result = set(Submission.objects.filter(user=profile, result='AC', points=F('problem__points'))
|
result = set(Submission.objects.filter(user=profile, result='AC', points=F('problem__points'))
|
||||||
.values_list('problem_id', flat=True).distinct())
|
.values_list('problem_id', flat=True).distinct())
|
||||||
cache.set(key, result, 300)
|
cache.set(key, result, 86400)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ def user_attempted_ids(profile):
|
||||||
.values_list('problem__id', 'problem__points')
|
.values_list('problem__id', 'problem__points')
|
||||||
.annotate(points=Max('points'))
|
.annotate(points=Max('points'))
|
||||||
.filter(points__lt=F('problem__points')))}
|
.filter(points__lt=F('problem__points')))}
|
||||||
cache.set(key, result, 300)
|
cache.set(key, result, 86400)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,4 +33,4 @@ sqlparse
|
||||||
channels
|
channels
|
||||||
channels-redis
|
channels-redis
|
||||||
docker
|
docker
|
||||||
|
python-memcached
|
||||||
|
|
Loading…
Reference in a new issue