mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 05:15:12 +00:00
10 lines
295 B
Python
10 lines
295 B
Python
import socket
|
|
|
|
from kombu import Connection, exceptions
|
|
|
|
try:
|
|
conn = Connection(settings.CELERY_BROKER_URL)
|
|
conn.ensure_connection(max_retries=2)
|
|
conn._close()
|
|
except (socket.error, exceptions.OperationalError):
|
|
return HttpResponseServerError("cache: cannot connect to broker.")
|