本文介绍了python apscheduler-跳过:已达到运行实例的最大数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我每秒使用Python apscheduler(版本3.0.1)执行一个函数
I am executing a function every second using Python apscheduler (version 3.0.1)
代码:
scheduler = BackgroundScheduler()
scheduler.add_job(runsync, 'interval', seconds=1)
scheduler.start()
大多数情况下工作正常,但有时会收到以下警告:
It's working fine most of the time but sometimes I get this warning:
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)
1。
2。此警告是什么意思?
2.What does this warning mean? Does it affect the execution of tasks inside the function in anyway?
3。如何处理此问题?
3.how to handle this?
推荐答案
这意味着该任务花费的时间超过一秒钟,并且默认情况下,给定作业仅允许一次并发执行。我无法告诉您如何处理此任务,而又不知道任务是什么。
It means that the task is taking longer than one second and by default only one concurrent execution is allowed for a given job. I cannot tell you how to handle this without knowing what the task is about.
这篇关于python apscheduler-跳过:已达到运行实例的最大数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!