From 77e64f1b853cfe8f4391389d7d4439da80f1379d Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Thu, 16 Jul 2020 21:30:48 -0500 Subject: [PATCH] Change cache to memcached --- judge/utils/problems.py | 4 ++-- requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/judge/utils/problems.py b/judge/utils/problems.py index fd1e75b..f87f807 100644 --- a/judge/utils/problems.py +++ b/judge/utils/problems.py @@ -39,7 +39,7 @@ def user_completed_ids(profile): if result is None: result = set(Submission.objects.filter(user=profile, result='AC', points=F('problem__points')) .values_list('problem_id', flat=True).distinct()) - cache.set(key, result, 300) + cache.set(key, result, 86400) return result @@ -65,7 +65,7 @@ def user_attempted_ids(profile): .values_list('problem__id', 'problem__points') .annotate(points=Max('points')) .filter(points__lt=F('problem__points')))} - cache.set(key, result, 300) + cache.set(key, result, 86400) return result diff --git a/requirements.txt b/requirements.txt index 564fa30..a7b9d9c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -33,4 +33,4 @@ sqlparse channels channels-redis docker - +python-memcached