Skip to content

feat(settings): 支持在系统设置中配置后台探针与恢复间隔#63

Merged
james-6-23 merged 2 commits intojames-6-23:mainfrom
ahjsrhj:feature/configure-probe-intervals
Apr 10, 2026
Merged

feat(settings): 支持在系统设置中配置后台探针与恢复间隔#63
james-6-23 merged 2 commits intojames-6-23:mainfrom
ahjsrhj:feature/configure-probe-intervals

Conversation

@ahjsrhj
Copy link
Copy Markdown
Contributor

@ahjsrhj ahjsrhj commented Apr 10, 2026

描述

本 PR 将账号后台巡检相关的几个硬编码时间参数改为可配置的系统设置,并在系统设置页面新增对应入口,支持持久化保存与运行时生效。

具体包括:

  • 新增“后台巡检间隔”
  • 新增“用量探针缓存时长”
  • 新增“恢复探测最小间隔”
  • 设置保存后写入数据库,并同步到运行中的 Store 配置
  • 前端设置页补充对应输入项与中英文文案

这样可以根据号池规模和使用场景,灵活调整后台遍历账号、请求 backend-api/codex/responses 的频率,减少不必要的探测流量。

变更类型

  • Bug 修复
  • 新功能
  • 文档更新
  • 代码重构

变更内容

  • 后端新增 3 个系统设置字段,并补齐 SQLite / PostgreSQL 的迁移与默认值
  • Store 新增运行时配置项与 getter/setter
  • 后台刷新循环支持根据新配置动态重置计时器
  • 用量探针与恢复探测逻辑改为读取系统设置中的时间值
  • 管理设置接口支持读取、校验、保存上述配置
  • 系统设置页面新增 3 个配置输入框
  • 新增对应中英文国际化文案

测试

  • 添加了单元测试
  • 手动测试通过
  • 所有现有测试通过

已执行:

  • go test ./...
  • cd frontend && npm run build

影响说明

  • 默认行为保持不变,默认值仍为:
    • 后台巡检间隔:2 分钟
    • 用量探针缓存时长:10 分钟
    • 恢复探测最小间隔:30 分钟
  • 保存设置后可实时生效,无需重启服务

相关 Issue

N/A

ahjsrhj added 2 commits April 10, 2026 12:20
- add persisted system settings for background refresh, usage probe max age, and recovery probe interval
- wire runtime updates into the store so saved intervals take effect without restart
- add settings page controls and i18n copy for the new scheduler timing options
@james-6-23 james-6-23 merged commit 7781bb9 into james-6-23:main Apr 10, 2026
1 check passed
@ahjsrhj ahjsrhj deleted the feature/configure-probe-intervals branch April 13, 2026 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants