diff --git a/src/notfellchen/celery.py b/src/notfellchen/celery.py new file mode 100644 index 0000000..042be7c --- /dev/null +++ b/src/notfellchen/celery.py @@ -0,0 +1,25 @@ +# /celery.py + +import os +from celery import Celery +from celery.schedules import crontab + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'notfellchen.settings') + +app = Celery('notfellchen') + +# Load task modules from all registered Django app configs. +app.config_from_object('django.conf:settings', namespace='CELERY') +app.autodiscover_tasks() + +app.conf.beat_schedule = { + 'daily-cleanup': { + 'task': 'admin.clean_locations', + 'schedule': crontab(hour=2), + }, + 'daily-deactivation': { + 'task': 'admin.deactivate_unchecked', + 'schedule': 30, + } +} +