apscheduler

Test if a job id exists APScheduler


Is there a simpler way of testing whether or not a job id exists other than using .get_jobs() and iterating through the list?

For instance something like:

if schedule.get_job(id='start1'):
    do this

Solution

  • Are you sure you've checked the API documentation?

    So:

    if scheduler.get_job('start1'):
       ...