Reputation: 2831
I have a current apscheduler
that runs the job mon-fri
and an interval of ~4 mins
all day long. Is it possible to run the job for a specific time range? Lets say from 9:00 am to 5:00 pm
in this case?
My expression looks like this:
scheduler.add_job(feed_data, 'cron', day_of_week='mon-fri', minute='*/3', jitter=30)
Is it possible to add start/end datetime
to this expression?
Upvotes: 0
Views: 2312
Reputation: 184
Here is simple answer:-
scheduler.add_job(
func=lambda: monday_break_scheduler(),
trigger=CronTrigger(day_of_week='mon', hour=17, minute=40)
)
also import this
from apscheduler.triggers.cron import CronTrigger
Upvotes: 1