From 314cdfdd7cefe62c5a894c80c5e32d3dbb8cd9e6 Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 10 Oct 2024 17:07:58 +0200 Subject: [PATCH] fix: Add missing celery file --- src/notfellchen/celery.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/notfellchen/celery.py 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, + } +} +