-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
项目中以接口的形式添加任务没有问题,但如果单独写一个文件测试添加任务,任务添加成功了,可是没有执行是什么原因 #20
Comments
有具体的代码示例吗? |
执行结果:
|
你应该是单独 你如果想要默认启动这个定时任务,可以把添加定时任务的操作,放到项目启动执行的操作中。 |
假如我想单独测试apscheduer,跟在不在fastapi项目没有关系吧。因为我这个测试文件,我也引入scheduler执行init_scheduler了 还有一个问题就是能知道某个任务的执行状态吗 |
单独测试 可以参考一下 stackoverflow上的回答。
可以根据任务ID去查看某个任务执行状态,可以参考我这个示例 ,具体更多的状态信息可以参考 apscheduler官方文档。 |
项目中以接口的形式添加任务没有问题,但如果单独写一个文件测试添加任务,任务添加成功了,可是没有执行是什么原因
The text was updated successfully, but these errors were encountered: