【问题标题】:How to add the misfire gracetime and coalesce in the active jobs in apscheduler?如何在 apscheduler 的活动作业中添加失火宽限期和合并?
【发布时间】:2016-08-23 09:43:48
【问题描述】:

我在 apscheduler(3.0.1) 中有 1000 个活动作业。我想将 misfire_grace_timecoalesce 添加到所有这些调度程序作业中。 因为这些字段只能在创建作业时添加。 有没有其他方法可以添加它们? 我能想到的一种解决方案是删除所有作业,然后添加所有作业。 这是代码sn-p:

当前工作:

  scheduler = get_scheduler()
  scheduler.add_job(executor_job, trigger='interval',seconds=100, id="sch:exe:1",
                  replace_existing=False)
  scheduler.start()

更新的配置应该是适合工作的:

  scheduler.add_job(executor_job, trigger='interval',seconds=100, id="sch:exe:1",
                  replace_existing=False,misfire_grace_time=900,coalesce=True)

谢谢

【问题讨论】:

    标签: python scheduled-tasks quartz-scheduler cron-task apscheduler


    【解决方案1】:

    我不知道您为什么说这些字段只能在创建作业时添加,但请看看这些:

    【讨论】:

      猜你喜欢
      • 2015-05-06
      • 2017-05-16
      • 2022-08-21
      • 2020-02-23
      • 2016-08-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多