python apscheduler - skipped: maximum number of running instances reached

出现问题的代码

1
2
3
scheduler = BackgroundScheduler()
scheduler.add_job(runsync, 'interval', seconds=1)
scheduler.start()

问题出现的情况

  • 运行一段代码,时而报错时而不报错
  • 报错是:
1
WARNING:apscheduler.scheduler:Execution of job "runsync (trigger: interval[0:00:01], next run at: 2015-12-01 11:50:42 UTC)" skipped: maximum number of running instances reached (1)

分析

  • apscheduler这个模块,在你的代码运行时间大于interval的时候,就会报错

    也就是说,你的代码运行时间超出了你的定时任务的时间间隔。

解决

  • 增大时间间隔即可

###


-------------The End-------------

Title:python apscheduler - skipped: maximum number of running instances reached

Author:cloud sjhan

Publish Time:2018年09月28日 - 16:09

Last Update:2018年09月28日 - 16:09

Original Link:https://cloudsjhan.github.io/2018/09/28/python-apscheduler-skipped-maximum-number-of-running-instances-reached/

License: By-NC-ND 4.0 international

cloud sjhan wechat
subscribe to my blog by scanning my public wechat account
keep going, keep coding
0%
;