Skip to content
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

单线程,DB连接被死循环占用,导致其它API 无法调用 sql #14

Open
zero-luo opened this issue Apr 20, 2021 · 0 comments

Comments

@zero-luo
Copy link

抱歉了 @CoderCharm ;这个问题可能这个项目关系不大,只是我实在找不到解决方法;我描述下我的问题;
首先基于这个demo 创建了两个api接口;
1、robot_status API 创建一个 BackgroundTasks 后台任务,用于收集第三方平台数据 ,插入进数据库
image
后台任务执行方法
image
image

2、get_robot_profit API 是获取数据库最新的 data
image

在不启动后台任务时,查询 数据、 插入数据 都能正常执行;

当我启动后台任务时,导致 get_robot_profit 这个API一直loading 获取不到数据;
后台中任务中数据插入是正常的;

请问这个问题要如何处理呢??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant