feat: Add healthcheck
This commit is contained in:
@@ -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),
|
||||
}
|
||||
|
@@ -84,6 +84,8 @@ LOCALE_PATHS = [os.path.join(BASE_DIR, 'locale')]
|
||||
CELERY_BROKER_URL = config.get("celery", "broker", fallback="redis://localhost:6379/0")
|
||||
CELERY_RESULT_BACKEND = config.get("celery", "backend", fallback="redis://localhost:6379/0")
|
||||
|
||||
""" MONITORING """
|
||||
HEALTHCHECKS_URL = config.get("monitoring", "healthchecks_url", fallback=None)
|
||||
|
||||
""" GEOCODING """
|
||||
GEOCODING_API_URL = config.get("geocoding", "api_url", fallback="https://nominatim.hyteck.de/search")
|
||||
|
Reference in New Issue
Block a user