feat: 自定义重试间隔策略 + 修复按钮hover样式

- 新增重试间隔阶段配置,支持自定义时间分界点和频率
- 默认配置: 0-8秒=130ms, 8-25秒=260ms, 25-75秒=900ms
- 设置面板添加可增删的阶段配置 UI
- 修复按钮 hover 时文字变白的问题
This commit is contained in:
yml2213
2026-06-26 13:46:46 +08:00
parent a955128887
commit 9bff652c66
8 changed files with 231 additions and 43 deletions
+13
View File
@@ -81,6 +81,16 @@ func defaultConfig() types.Config {
LogLevel: "info",
Concurrency: constants.DefaultConcurrency,
Attempts: constants.DefaultAttempts,
RetryStages: defaultRetryStages(),
}
}
// defaultRetryStages 返回默认重试间隔阶段配置。
func defaultRetryStages() []types.RetryStage {
return []types.RetryStage{
{MaxElapsed: 8, Interval: 130},
{MaxElapsed: 25, Interval: 260},
{MaxElapsed: 75, Interval: 900},
}
}
@@ -118,6 +128,9 @@ func LoadConfig(path string) types.Config {
if cfg.LogLevel == "" {
cfg.LogLevel = "info"
}
if len(cfg.RetryStages) == 0 {
cfg.RetryStages = defaultRetryStages()
}
logger.LogEvent("配置", "success", "配置加载完成: %s", path)
return cfg
}