apscheduler cron job is not executing

核能气质少年 提交于 2020-01-15 07:47:13

问题


I am using apscheduler with a persistent job store through sqlalchemy in a flask application. flask-sqlalchemy module is being used.

Jobs without triggers and a persistent job store are executing. However, with cron jobs, the 'next_run_time' is always updated but the job does not execute. In case of misfire, I want the job to only run once.

## relevant global config variables for flask app
SCHEDULER_EXECUTORS = {
        'default': {'type': 'threadpool', 'max_workers': 20}
    }
    SCHEDULER_JOB_DEFAULTS = {
        'coalesce': True,
        'max_instances': 1
    }


## add scheduled job
    app.config['JOBS'].append({
            'id': '{job_id}',
            'replace_existing' : True,
            'func': '{module_to_kickoff}:{function}',
            'jobstore': 'default',
            'trigger': 'cron',
            #'misfire_grace_time': 79200,  # 22 hours
        'day': '*', 'hour': 1, 'minute': 0
    })

来源:https://stackoverflow.com/questions/54064033/apscheduler-cron-job-is-not-executing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!