Repository navigation
fix: 处理轮换时间不变时的额度回升 - #7
Merged
Merged
Conversation
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.
订阅续期可能让额度回升,但上游的 5h/7D 重置时间仍保持不变。原估算会继续累计续期前的请求金额,导致后续总额和可用金额偏高。
本次按同一账号、同一窗口、同一重置时间下的额度回升建立新的用量基线,并持久化观测以支持重启恢复。满额观测也会建立基线;若轮询时新额度已经部分消耗,则按基线之后的用量比例差值估算。金额与缓存命中率使用一致的时间边界,上游轮换时间保持原值,旧后台任务不会覆盖新结果。
检测依据是额度变化,并非订阅事件;上游用量修正也可能触发,轮询间发生但未表现为额度回升的续期无法识别。
验证:
npm run typecheck通过。git diff --check通过。