[Python] Find periodic task's next execution time in Celery Beat

Discussão em 'Python' iniciado por Stack, Maio 23, 2025.

  1. Stack

    Stack Membro Participativo

    I am creating PeriodicTasks for opening user an access to the next lesson using this code:

    task = PeriodicTask.objects.create(
    interval=enrolment.course.interval,
    name=f"enrolment_id: {enrolment.id}",
    task="courses.tasks.next_program",
    args=json.dumps([enrolment.id]),
    )
    enrolment.task = task
    enrolment.save()


    How to get datetime next task will be ran?

    Continue reading...

Compartilhe esta Página