如何在特定结束日期停止“ Blockscheduler”?

问题描述 投票:0回答:1

我正在使用Blockscheduler()在工作日运行解决方案(用烧瓶编写),并且最终应在提到的特定日期结束。我的代码看起来像这样

sched = BlockingScheduler()  
sched.add_job(job_function, 'cron', day_of_week='mon-fri', 
hour=9, minute=13, end_date='2020-06-05 09:14:00')  

sched.start()

它应该在该特定日期停止,但是以某种方式不会停止。

[请让我知道我在哪里做错。

谢谢。

python flask scheduler apscheduler
1个回答
0
投票

如果您希望在作业完成后关闭调度程序,只需在job_function的末尾调用sched.shutdown(wait=False)

© www.soinside.com 2019 - 2024. All rights reserved.