How to change the status of the trigger if the previous execution takes longer than the actual time

If a task is scheduled to run for every 5 min and the task is running longer than that in that case I want to delete the next trigger from the queue or any other alternative solution would be also fine.

Example: the task is scheduled at 12:00, so the next trigger would be at 12:05 and 12:10 and so on. if trigger at 12:00 finishes its execution at 12:07 in that case I want the task to wait for the next trigger that is 12:10 not to continue immediately which is what happens currently.

1 answer

  • answered 2021-09-23 10:40 Elad

    These are the options:

    schedule_interval='*/5 * * * *' - will give you 12:00, 12:05, 12:10 - a new run will start on schedule as soon as it arrives.

    schedule_interval=datetime.timedelta(minutes=5) - will give you a run 5 minutes after the last run was ended.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum