apscheduler.job

API

class apscheduler.job.Job(scheduler, id=None, **kwargs)

Contains the options given when scheduling callables and its current schedule and other state. This class should never be instantiated by the user.

Variables:
  • id (str) – the unique identifier of this job
  • name (str) – the description of this job
  • func – the callable to execute
  • args (tuple|list) – positional arguments to the callable
  • kwargs (dict) – keyword arguments to the callable
  • coalesce (bool) – whether to only run the job once when several run times are due
  • trigger – the trigger object that controls the schedule of this job
  • executor (str) – the name of the executor that will run this job
  • misfire_grace_time (int) – the time (in seconds) how much this job’s execution is allowed to be late
  • max_instances (int) – the maximum number of concurrently executing instances allowed for this job
  • next_run_time (datetime.datetime) – the next scheduled run time of this job

Note

The misfire_grace_time has some non-obvious effects on job execution. See the Missed job executions and coalescing section in the documentation for an in-depth explanation.

modify(**changes)

Makes the given changes to this job and saves it in the associated job store.

Accepted keyword arguments are the same as the variables on this class.

See also

modify_job()

Return Job:this job instance
pause()

Temporarily suspend the execution of this job.

See also

pause_job()

Return Job:this job instance
pending

Returns True if the referenced job is still waiting to be added to its designated job store.

remove()

Unschedules this job and removes it from its associated job store.

See also

remove_job()

reschedule(trigger, **trigger_args)

Shortcut for switching the trigger on this job.

See also

reschedule_job()

Return Job:this job instance
resume()

Resume the schedule of this job if previously paused.

See also

resume_job()

Return Job:this job instance