A variety of updates were made to improve the toggle documentation: * Added comments to help ensure that the waffle(), waffle_switches(), waffle_flags() anti-pattern won't be contagious (copied). * Some minor toggle_description updates. * Removed empty toggle_target_removal_date annotations for non-temporary toggles. * Removed empty optional toggle_warnings annotations. * Removed empty optional toggle_tickets annotations. * Removed deprecated toggle_category, toggle_status, and toggle_expiration_date annotations. * Fixed some indents, use cases, and implementations. ARCHBOM-1721
26 lines
1.3 KiB
Python
26 lines
1.3 KiB
Python
""" Course API """
|
|
|
|
|
|
from edx_toggles.toggles import LegacyWaffleSwitch, LegacyWaffleSwitchNamespace
|
|
|
|
WAFFLE_SWITCH_NAMESPACE = LegacyWaffleSwitchNamespace(name='course_list_api_rate_limit')
|
|
|
|
# .. toggle_name: course_list_api_rate_limit.rate_limit_2
|
|
# .. toggle_implementation: WaffleSwitch
|
|
# .. toggle_default: False
|
|
# .. toggle_description: Waffle switch to enable the throttling of 2 requests/minute to the course API. For staff
|
|
# users, this limit is 10 requests/minute.
|
|
# .. toggle_use_cases: circuit_breaker
|
|
# .. toggle_creation_date: 2018-06-12
|
|
# .. toggle_tickets: https://openedx.atlassian.net/browse/LEARNER-5527
|
|
USE_RATE_LIMIT_2_FOR_COURSE_LIST_API = LegacyWaffleSwitch(WAFFLE_SWITCH_NAMESPACE, 'rate_limit_2', __name__)
|
|
# .. toggle_name: course_list_api_rate_limit.rate_limit_10
|
|
# .. toggle_implementation: WaffleSwitch
|
|
# .. toggle_default: False
|
|
# .. toggle_description: Waffle switch to enable the throttling of 10 requests/minute to the course API. For staff
|
|
# users, this limit is 20 requests/minute.
|
|
# .. toggle_use_cases: circuit_breaker
|
|
# .. toggle_creation_date: 2018-06-12
|
|
# .. toggle_tickets: https://openedx.atlassian.net/browse/LEARNER-5527
|
|
USE_RATE_LIMIT_10_FOR_COURSE_LIST_API = LegacyWaffleSwitch(WAFFLE_SWITCH_NAMESPACE, 'rate_limit_10', __name__)
|