Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cms/envs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@

CLEAR_REQUEST_CACHE_ON_TASK_COMPLETION = False

HIGH_PRIORITY_QUEUE = 'edx.cms.core.high'

# test_status_cancel in cms/cms_user_tasks/test.py is failing without this
# @override_setting for BROKER_URL is not working in testcase, so updating here
BROKER_URL = 'memory://localhost/'
Expand Down
11 changes: 10 additions & 1 deletion lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,16 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring
)

HEARTBEAT_CELERY_TIMEOUT = 5
HEARTBEAT_CELERY_ROUTING_KEY = HIGH_PRIORITY_QUEUE


def _high_priority_queue(settings):
"""
HIGH_PRIORITY_QUEUE is defined differently in *.envs.production
"""
return settings.HIGH_PRIORITY_QUEUE

HEARTBEAT_CELERY_ROUTING_KEY = _high_priority_queue
derived('HEARTBEAT_CELERY_ROUTING_KEY')

################################ Block Structures ###################################

Expand Down
2 changes: 2 additions & 0 deletions lms/envs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,8 @@

CLEAR_REQUEST_CACHE_ON_TASK_COMPLETION = False

HIGH_PRIORITY_QUEUE = 'edx.lms.core.high'

######################### MARKETING SITE ###############################

MKTG_URL_LINK_MAP = {
Expand Down
5 changes: 5 additions & 0 deletions openedx/core/djangoapps/heartbeat/tests/test_heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
from unittest.mock import patch

from django.conf import settings
from django.db.utils import DatabaseError
from django.test.client import Client
from django.urls import reverse
Expand All @@ -24,6 +25,10 @@ def setUp(self):
self.heartbeat_url = reverse('heartbeat')
return super().setUp()

def test_settings(self):
assert settings.HEARTBEAT_CELERY_ROUTING_KEY == settings.HIGH_PRIORITY_QUEUE
assert settings.HEARTBEAT_CELERY_ROUTING_KEY in settings.CELERY_QUEUES

def test_success(self):
response = self.client.get(self.heartbeat_url + '?extended')
print(response)
Expand Down