refactor(health-check): replace default views with custom configuration

migrated health check configuration to custom settings for more precise control. Removed unused `health_check` submodules to streamline dependencies. Updated URLs to use `HealthCheckView` with tailored checks. Streamlines health monitoring and reduces unnecessary bloat.
This commit is contained in:
Egor Pavlovich Gorbunov 2026-02-21 20:24:33 +03:00
parent 72834f01f6
commit ec167d4e9c
2 changed files with 22 additions and 12 deletions

View file

@ -128,15 +128,6 @@ INSTALLED_APPS: list[str] = [
"django.contrib.gis",
"django.contrib.humanize",
"health_check",
"health_check.db",
"health_check.cache",
"health_check.storage",
"health_check.contrib.migrations",
"health_check.contrib.celery_ping",
"health_check.contrib.psutil",
"health_check.contrib.redis",
"health_check.contrib.db_heartbeat",
"health_check.contrib.mail",
"cacheops",
"django_celery_beat",
"django_celery_results",

View file

@ -3,6 +3,8 @@ from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
from django.views.decorators.csrf import csrf_exempt
from health_check.views import HealthCheckView
from redis.asyncio import Redis as RedisClient
from engine.core.graphene.schema import schema
from engine.core.views import (
@ -21,9 +23,26 @@ urlpatterns = [
index,
),
path(
r"health/",
include(
"health_check.urls",
"health/",
HealthCheckView.as_view(
checks=[
"health_check.Cache",
"health_check.DNS",
"health_check.Database",
"health_check.Mail",
"health_check.Storage",
"health_check.contrib.psutil.Disk",
"health_check.contrib.psutil.Memory",
"health_check.contrib.celery.Ping",
(
"health_check.contrib.redis.Redis",
{
"client_factory": lambda: RedisClient.from_url(
settings.CELERY_BROKER_URL
)
},
),
],
),
),
path(