mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 18:37:46 +08:00
fix(pool): 配额倒计时归零后进度条与列表恢复显示 100%
- 后端读取层 provider_key_status_snapshot_payload 复用调度侧同一判定 provider_pool_reset_deadline_elapsed,对已到期的 Codex 配额窗口归一化为 used_ratio=0 / remaining_ratio=1,并清除窗口级耗尽标记;跳过 window_minutes=0 与无用量观测的窗口 - 前端展示层在倒计时归零(isExpired)时兜底显示 100%,并隐藏重置前的旧用量 文本,保证归零瞬间即时恢复,与后端读取口径、调度口径一致 - 补充后端 2 个单测(到期归一化、遗留耗尽状态清理)与前端 1 个回归用例 (负向验证可复现旧行为) 验证:aether-provider-pool 71/71;aether-gateway lib 回归通过(仅 3 个依赖 PostgreSQL 服务端的用例因本机环境缺失失败,与本改动无关);前端 222 文件 / 1718 用例全部通过;clippy -D warnings、cargo fmt、vue-tsc、eslint 均通过。
This commit is contained in:
@@ -43,7 +43,7 @@ pub use quota::{
|
||||
provider_pool_key_model_quota_hard_blocked, provider_pool_key_quota_hard_blocked,
|
||||
provider_pool_key_scheduling_label, provider_pool_member_quota_snapshot,
|
||||
provider_pool_quota_metadata_provider_type, provider_pool_quota_metadata_updated_at,
|
||||
provider_pool_quota_snapshot_updated_at,
|
||||
provider_pool_quota_snapshot_updated_at, provider_pool_reset_deadline_elapsed,
|
||||
};
|
||||
pub use quota_refresh::ProviderPoolQuotaRequestSpec;
|
||||
pub use service::ProviderPoolService;
|
||||
|
||||
@@ -857,7 +857,14 @@ fn provider_pool_reset_deadline_unix_secs(
|
||||
})
|
||||
}
|
||||
|
||||
pub(crate) fn provider_pool_reset_deadline_elapsed(
|
||||
/// Whether the quota window's reset deadline has already passed.
|
||||
///
|
||||
/// The deadline is taken from `reset_at`/`next_reset_at` when present, otherwise
|
||||
/// derived from `reset_seconds`/`reset_after_seconds` anchored at the window (or
|
||||
/// fallback) observation time. Scheduling ignores exhausted windows once this is
|
||||
/// true; read paths can reuse the same predicate so the displayed quota matches
|
||||
/// the scheduling decision after a reset.
|
||||
pub fn provider_pool_reset_deadline_elapsed(
|
||||
item: &Map<String, Value>,
|
||||
fallback_observed_at: Option<u64>,
|
||||
now_unix_secs: u64,
|
||||
|
||||
Reference in New Issue
Block a user