我使用的是一个使用python的调度程序apscheduler.scheduler我的项目有300个工作。在
因为我有300个任务要运行,所以我增加了线程的数量
//scheduler.py
from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor
from apscheduler.schedulers.background import BackgroundScheduler
executors = {
'default': ThreadPoolExecutor(300), # max threads: 300
'processpool': ProcessPoolExecutor(70) # max processes 70
}
job_defaults = {
'coalesce': False,
'max_instances': 4
}
scheduler = BackgroundScheduler(executors=executors, job_defaults=job_defaults)
scheduler.start()
上面的配置一旦在后台启动这个apscheduler脚本就可以工作了,但是几个小时后它就会自动停止。我正在使用nohup在后台运行此服务
^{pr2}$谁能帮我弄清楚这个问题的起因吗?在
谢谢
目前没有回答
相关问题 更多 >
编程相关推荐