我使用的是一个使用python的调度程序apscheduler.scheduler,在我的项目中,有太多的作业在运行,但是机器的负载并不是太高,在看过文档之后,我找到了一个解决方案,我必须增加线程的大小,但是我不知道,如何增加线程 我的syntex:
scheduler.add_interval_job(triggerTask, interval_time, args=[], misfire_grace_time = None)
scheduler.add_cron_job(triggerTask, interval_time, args=[], misfire_grace_time = None)
由于您有90个任务要运行,您可能需要增加线程的数量,如果它们是计算敏感的,您还应该使用
ProcessPoolExecutor
:scheduler
将使用default
executor default,您可以通过scheduler.add_interval_job(triggerTask, interval_time, executor="<executor's name>")
指定executor。在相关问题 更多 >
编程相关推荐