Rate limit course list API.

This endpoint is likely being inefficient with how it's querying various parts
of the code and can take courseware down, it needs to be rate limited until
optimized.

LEARNER-5527
This commit is contained in:
Waheed Ahmed
2018-06-12 23:12:13 +05:00
parent 285ae08d42
commit 780c1d982d
3 changed files with 81 additions and 1 deletions

View File

@@ -1 +1,7 @@
""" Course API """
from openedx.core.djangoapps.waffle_utils import (WaffleSwitch, WaffleSwitchNamespace)
WAFFLE_SWITCH_NAMESPACE = WaffleSwitchNamespace(name='course_list_api_rate_limit')
USE_RATE_LIMIT_2_FOR_COURSE_LIST_API = WaffleSwitch(WAFFLE_SWITCH_NAMESPACE, 'rate_limit_2')
USE_RATE_LIMIT_10_FOR_COURSE_LIST_API = WaffleSwitch(WAFFLE_SWITCH_NAMESPACE, 'rate_limit_10')