APScheduler 3.7.0 released

114 views
Skip to first unread message

Alex Grönholm

unread,
Jan 20, 2021, 8:20:32 AM1/20/21
to APScheduler
I've released APScheduler 3.7.0 yesterday. I figured that since the work
on v4.0 is taking longer than I initially hoped, it would be prudent to
at least fix a bunch of persistent bugs and shortcomings in the current
release branch. The new release contains a total of 13 fixes to various
annoyances. Python 3.4 support was phased out, as it's long since
reached its end of life. APScheduler 4.0, on the other hand, is expected
to drop at least Python 3.5 support, likely 3.6 as well.

There won't be any more feature releases on the 3.x series. Regressions
will be fixed, but design problems will have to be dealt with in the 4.x
series.

schatur...@gmail.com

unread,
Feb 2, 2021, 6:13:41 AM2/2/21
to APScheduler
Hi,
I want to print the next run time of a particular job every time before the job is triggered. I've learned about get_jobs, but it only prints the next run time only once. Can you please tell me how can i print the next run time every time. I'm sorry if the answer is very obvious as I'm new to this module. I've attached the code snippet below. Thanks in advance.
1.PNG

Alex Grönholm

unread,
Feb 2, 2021, 7:06:30 AM2/2/21
to apsch...@googlegroups.com

You can subscribe to executor events using scheduler.add_listener(). See here: https://apscheduler.readthedocs.io/en/stable/userguide.html#scheduler-events

You will want to inspect every JobExecutionEvent and get the scheduled_run_time attribute in it.

Let me know if you have trouble getting this to work.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/apscheduler/90c850c4-9177-4432-bef9-552534d8ace3n%40googlegroups.com.

schatur...@gmail.com

unread,
Feb 2, 2021, 1:00:19 PM2/2/21
to APScheduler
Can you please explain how "class apscheduler.events.JobSubmissionEvent(codejob_idjobstorescheduled_run_times)" works.

Alex Grönholm

unread,
Feb 2, 2021, 2:29:50 PM2/2/21
to apsch...@googlegroups.com

Such an event is emitted every time a job has been submitted to the designated executor. The "scheduled_run_times" property is a list of datetimes the job was supposed to have been started on, after the last run time of the job up until the present time (can be multiple values when coalescing is enabled).

Sukrati Chaturvedi

unread,
Feb 3, 2021, 3:00:03 AM2/3/21
to apsch...@googlegroups.com
Thanks! Can I request you to give an example demonstrating the use of "scheduler.add_listener()"  for  printing next run time everytime the job is triggered so that it can be more clear to me.

Alex Grönholm

unread,
Feb 3, 2021, 3:02:27 AM2/3/21
to apsch...@googlegroups.com

So I wouldn't always have to write example code for everyone, I'd like to ask if you've read this part of the documentation: https://apscheduler.readthedocs.io/en/stable/userguide.html#scheduler-events

Is there something I didn't explain properly here?

Sukrati Chaturvedi

unread,
Feb 3, 2021, 3:14:42 AM2/3/21
to apsch...@googlegroups.com
Sorry, I didn't mean anything like that.And yes, I have read the mentioned part of documentation a few times but it's me who is not able to understand how this thing can be embedded in my program. 

You received this message because you are subscribed to a topic in the Google Groups "APScheduler" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/apscheduler/MwIHiRkOAD8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to apscheduler...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/apscheduler/a9ebd9d6-3388-f3a5-76ba-6b4052fe37dd%40nextday.fi.

Alex Grönholm

unread,
Feb 3, 2021, 3:15:49 AM2/3/21
to apsch...@googlegroups.com

Well, that documentation section has an actual example, so you need to tell me what part you're having difficulties with so that I can assist you.

Sukrati Chaturvedi

unread,
Mar 1, 2021, 3:22:48 AM3/1/21
to apsch...@googlegroups.com
Hi Alex,
Thanks for all of your support. I've another doubt regarding apscheduler.  Is there any possible way to get the list of all the jobs that have been paused. If yes, how can we do that?

Alex Grönholm

unread,
Mar 1, 2021, 5:11:35 AM3/1/21
to apsch...@googlegroups.com

You can get a list of all jobs using scheduler.get_jobs() (after the scheduler has been started). You can then identify paused jobs by looking at the next_run_time attribute which is None for paused jobs.

Sukrati Chaturvedi

unread,
Mar 5, 2021, 11:55:28 PM3/5/21
to apsch...@googlegroups.com
Thanks.It worked. Also, is there any documentation for queuing disciplines and setting preemptive and non-preemptive priorities of jobs in APScheduler 

Alex Grönholm

unread,
Mar 6, 2021, 4:39:43 AM3/6/21
to apsch...@googlegroups.com

There is no documentation for that because there is no such feature in APScheduler. If you want something like that, you'll have to implement it yourself.

Reply all
Reply to author
Forward
0 new messages