health: Disable RabbitMQ check if not USING_RABBITMQ.

Fixes a spurious error that’s logged and ignored during the Puppeteer
tests, introduced by commit eef65d7e30
(#31438).

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-10-12 18:01:02 -07:00 committed by Tim Abbott
parent 723346b05c
commit ff97788b6e
1 changed files with 3 additions and 1 deletions

View File

@ -1,3 +1,4 @@
from django.conf import settings
from django.db.migrations.recorder import MigrationRecorder from django.db.migrations.recorder import MigrationRecorder
from django.http import HttpRequest, HttpResponse from django.http import HttpRequest, HttpResponse
from django.utils.crypto import get_random_string from django.utils.crypto import get_random_string
@ -58,6 +59,7 @@ def check_memcached() -> None:
def health(request: HttpRequest) -> HttpResponse: def health(request: HttpRequest) -> HttpResponse:
check_database() check_database()
if settings.USING_RABBITMQ: # nocoverage
check_rabbitmq() check_rabbitmq()
check_redis() check_redis()
check_memcached() check_memcached()