-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: always select ID in GetAll pagination to prevent infinite loop #2497
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
base: main
Are you sure you want to change the base?
Conversation
|
maozh seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Codecov Report❌ Patch coverage is
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
@zero4197 还有几个设计了 getSelcted 的地方,麻烦辛苦一起改下吧 |
总共有7个,部分有用ID当游标来分页的,部分没有,为防止后面上游再使用ID当游标分页,只要是opt!=nil的,我统一都加上了查询ID字段。 |
Albertchamberlain
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM



issues地址:#2496
backend/domain/plugin/internal/dal/model/agent_tool_draft.gen.go第149-180行GetAll()函数中。
使用分页的逻辑来查询工具,分页的游标为ID,但是在select语句中,没有加上ID这个参数,导致只要是数据达到20,该分页的for循环就会陷入死循环。opencoze和mysql的cpu会激增最终导致系统死机。
修复:
在getSelected中加上ID选择