fix: 修复管理后台分组页可用账号数显示错误#2508
Open
honue wants to merge 1 commit into
Open
Conversation
Contributor
|
All contributors have signed the CLA. ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更说明
修复管理后台分组列表中“可用账号数”的显示逻辑错误。
此前前端使用的是:
active_account_count - rate_limited_account_count但后端返回的
active_account_count本身已经表示:status = activeschedulable = true也就是说,这个字段已经是当前可用账号数。前端再减一次
rate_limited_account_count,会把部分本来就不在可用集合里的账号重复扣减,导致页面出现负数结果。修复内容
将管理后台分组页中的“可用账号数”改为直接显示:
active_account_count不再额外减去
rate_limited_account_count。修复原因
当前后端分组统计口径为:
active_account_count:活跃且可调度的账号数rate_limited_account_count:当前处于限流 / overload / 临时不可调度状态的账号数由于
active_account_count已经可以直接表示该页面所需的“可用账号数”,前端继续减去rate_limited_account_count属于重复扣减,逻辑不正确。示例
以
codex分组为例:active_account_count = 5rate_limited_account_count = 10旧逻辑显示:
5 - 10 = -5修复后显示:
5