Wait until task is finished to run next one?

1,358 views
Skip to first unread message

Barry

unread,
Oct 3, 2013, 12:00:49 PM10/3/13
to apsch...@googlegroups.com
Hi, is there any way in APScheduler to make it so if 2 tasks are scheduled at the same time (or one is schedule to start when another is still running) it waits until the first task is completed before doing the other one? 

Barry

unread,
Oct 3, 2013, 12:07:41 PM10/3/13
to apsch...@googlegroups.com

My tasks take a max. of 5 minutes to complete, so alternatively if there is no way to do that, is there a way to check when scheduling a task if any other tasks are scheduled within 5 minutes of the current task, and if so, add 5 minutes onto the tasks execution time. If you get what I mean? Sorry, I'm terrible at explaining things.


Thanks for any help in advance by the way, I appreciate the work you've done on APscheduler it's helped me a lot with my personal projects.

Alex Grönholm

unread,
Oct 3, 2013, 3:36:21 PM10/3/13
to apsch...@googlegroups.com
03.10.2013 19:07, Barry kirjoitti:

My tasks take a max. of 5 minutes to complete, so alternatively if there is no way to do that, is there a way to check when scheduling a task if any other tasks are scheduled within 5 minutes of the current task, and if so, add 5 minutes onto the tasks execution time. If you get what I mean? Sorry, I'm terrible at explaining things.
Not automatically, but you can manually reschedule the job if you iterate through all the jobs and check next_run_time.


Thanks for any help in advance by the way, I appreciate the work you've done on APscheduler it's helped me a lot with my personal projects.
On Thursday, 3 October 2013 17:00:49 UTC+1, Barry wrote:
Hi, is there any way in APScheduler to make it so if 2 tasks are scheduled at the same time (or one is schedule to start when another is still running) it waits until the first task is completed before doing the other one? 
--
You received this message because you are subscribed to the Google Groups "APScheduler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apscheduler...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Barry

unread,
Oct 4, 2013, 12:27:23 PM10/4/13
to apsch...@googlegroups.com
Thanks for your reply, to reschedule can I just change the next_run_time on the job or do I have to delete the job and create a new one?

Alex Grönholm

unread,
Oct 4, 2013, 12:28:22 PM10/4/13
to apsch...@googlegroups.com
04.10.2013 19:27, Barry kirjoitti:
Thanks for your reply, to reschedule can I just change the next_run_time on the job or do I have to delete the job and create a new one?

You have to delete it and create a new one. Perhaps in the future there will be an option to actually reschedule.
Reply all
Reply to author
Forward
0 new messages