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: 1 addition & 1 deletion intel_owl/settings/celery.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from ._util import get_secret
from .aws import AWS_SQS
from .chatbot import CHATBOT_QUEUE

RESULT_BACKEND = "django-db"
BROKER_URL = get_secret("BROKER_URL", None)
Expand All @@ -18,7 +19,6 @@
BROADCAST_QUEUE = "broadcast"
CONFIG_QUEUE = "config"

CHATBOT_QUEUE = "chatbot"

CELERY_QUEUES = get_secret("CELERY_QUEUES", DEFAULT_QUEUE).split(",")
for queue in [DEFAULT_QUEUE, CONFIG_QUEUE, CHATBOT_QUEUE]:
Expand Down
9 changes: 9 additions & 0 deletions tests/api_app/chatbot_manager/test_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ def test_unavailable_when_worker_serves_a_different_queue(self, mock_get):
mock_get.return_value = MagicMock(ok=True)
self.assertFalse(chatbot_health().available)

def test_chatbot_queue_setting_configured_from_secrets(self):
with patch(
"intel_owl.secrets.get_secret",
side_effect=lambda name, default=None: "custom_queue" if name == "CHATBOT_QUEUE" else default,
):
from intel_owl.settings import chatbot

self.assertEqual(chatbot.CHATBOT_QUEUE, "custom_queue")


class ChatHealthViewTestCase(APITestCase):
URL = "/api/chatbot/health"
Expand Down
Loading