feat: Add healthcheck

This commit is contained in:
2024-10-10 18:35:22 +02:00
parent e38234b736
commit 74a6b5f2aa
4 changed files with 30 additions and 8 deletions

View File

@@ -1,8 +1,7 @@
# <your_project>/celery.py
import os
from celery import Celery
from celery.schedules import crontab
from notfellchen import settings
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'notfellchen.settings')
@@ -19,7 +18,12 @@ app.conf.beat_schedule = {
},
'daily-deactivation': {
'task': 'admin.deactivate_unchecked',
'schedule': 30,
}
'schedule': crontab(hour=1),
},
}
if settings.HEALTHCHECK_URL is not None:
# If a healthcheck is configured, this will send a daily ping to the healthchecks server
app.conf.beat_schedule['daily-healthcheck'] = {'task': 'tools.healthcheck',
'schedule': crontab(hour=2),
}