Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-submissions
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-submissions
Commits
ca03854d
Commit
ca03854d
authored
Aug 11, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set a cache timeout for top scores
parent
b7049bcb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
+8
-1
submissions/api.py
+8
-1
No files found.
submissions/api.py
View file @
ca03854d
...
...
@@ -18,8 +18,15 @@ from submissions.models import Submission, StudentItem, Score, ScoreSummary
logger
=
logging
.
getLogger
(
"submissions.api"
)
# By default, limit the number of top submissions
# Anything above this limit will result in a request error
MAX_TOP_SUBMISSIONS
=
100
# Set a relatively low cache timeout for top submissions.
TOP_SUBMISSIONS_CACHE_TIMEOUT
=
300
class
SubmissionError
(
Exception
):
"""An error that occurs during submission actions.
...
...
@@ -461,7 +468,7 @@ def get_top_submissions(course_id, item_id, item_type, number_of_top_scores, use
]
# Always store the retrieved list in the cache
cache
.
set
(
cache_key
,
top_submissions
)
cache
.
set
(
cache_key
,
top_submissions
,
TOP_SUBMISSIONS_CACHE_TIMEOUT
)
return
top_submissions
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment