fix: Add missing celery file
This commit is contained in:
parent
4504a18f60
commit
314cdfdd7c
25
src/notfellchen/celery.py
Normal file
25
src/notfellchen/celery.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# <your_project>/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,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user