2020-05-24 15:44:27 +00:00
|
|
|
from django_celery_beat.models import PeriodicTask, IntervalSchedule
|
|
|
|
|
|
|
|
def setup_cron():
|
|
|
|
schedule, created = IntervalSchedule.objects.get_or_create(
|
2020-05-25 17:28:34 +00:00
|
|
|
every=5,
|
|
|
|
period=IntervalSchedule.SECONDS,
|
2020-05-24 15:44:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
PeriodicTask.objects.get_or_create(
|
|
|
|
interval=schedule,
|
|
|
|
name='Expephacron',
|
|
|
|
task='cron',
|
|
|
|
)
|