1. 16 Mar, 2026 1 commit
    • erio's avatar
      fix(billing): add window expiration check to Redis rate limit Lua script · 67c05062
      erio authored
      The updateRateLimitUsageScript Lua script previously performed
      unconditional HINCRBYFLOAT on all usage counters without checking
      whether the rate limit window had expired. This caused usage to
      accumulate across window boundaries in Redis while the DB correctly
      reset on expiration, leading to incorrect 429 rate limiting that
      could persist for up to 24 hours.
      
      The Lua script now checks each window timestamp before incrementing:
      - If the window has expired, usage is reset to the current cost and
        the window timestamp is updated (matching DB-side semantics)
      - If the window is still valid, usage is accumulated normally
      
      This also resolves the async race condition where stale HINCRBYFLOAT
      tasks from the worker queue could pollute a freshly rebuilt cache
      after invalidation, since the script now self-corrects expired windows.
      
      Closes #1049
      67c05062
  2. 15 Mar, 2026 3 commits
  3. 14 Mar, 2026 4 commits
  4. 13 Mar, 2026 1 commit
    • wucm667's avatar
      feat: 账号配额支持固定时间重置模式 · 5b850059
      wucm667 authored
      - 后端新增 rolling/fixed 两种配额重置模式,支持日配额和周配额
      - fixed 模式下可配置重置时刻(小时)、重置星期几(周配额)及时区(IANA)
      - 在 account_repo.go 中使用 SQL 表达式适配两种模式的过期判断与重置时间推进
      - 新增 ComputeQuotaResetAt / ValidateQuotaResetConfig 等辅助函数
      - DTO 层新增相关字段并在 mappers 中完整映射
      - 前端 QuotaLimitCard 新增 rolling/fixed 切换 UI、时区选择器
      - CreateAccountModal / EditAccountModal 透传新配置字段
      - i18n(zh/en)同步新增相关翻译词条
      5b850059
  5. 12 Mar, 2026 9 commits
  6. 11 Mar, 2026 6 commits
  7. 09 Mar, 2026 3 commits
  8. 07 Mar, 2026 8 commits
  9. 05 Mar, 2026 5 commits