diff --git a/intel_owl/settings/celery.py b/intel_owl/settings/celery.py index e3d6dfb498..dd2df8e9fb 100644 --- a/intel_owl/settings/celery.py +++ b/intel_owl/settings/celery.py @@ -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) @@ -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]: diff --git a/tests/api_app/chatbot_manager/test_health.py b/tests/api_app/chatbot_manager/test_health.py index d8ed8f8842..8e92c1e521 100644 --- a/tests/api_app/chatbot_manager/test_health.py +++ b/tests/api_app/chatbot_manager/test_health.py @@ -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"