expephalon/core/helpers/cron.py
Klaus-Uwe Mitterer 27fe413d11 Some refactoring to get cron running
Moved dbsettings documentation to Gitlab wiki
2020-05-24 17:44:27 +02:00

13 lines
No EOL
338 B
Python

from django_celery_beat.models import PeriodicTask, IntervalSchedule
def setup_cron():
schedule, created = IntervalSchedule.objects.get_or_create(
every=1,
period=IntervalSchedule.MINUTES,
)
PeriodicTask.objects.get_or_create(
interval=schedule,
name='Expephacron',
task='cron',
)