There is no default trigger for starting a task immediately, to achieve this you can get the current time and set the DateTrigger for the task as follows:
my_job.modify_job(trigger=DateTrigger(run_date=datetime.datetime.now()))
this way you will "force" to complete the task, but you need to insert the task again in the scheduler, another option simply creates a new task to run the same function using the add_job function
sched.add_job(func=your_function(),
trigger=DateTrigger(run_date=datetime.datetime.now()))
this way you do not need to take any extra steps.
source
share