Merge pull request #493 from simonjiang99/fix/3-minutes-minimum

fix(api):enforce minimum scan interval of three minutes
This commit is contained in:
tinkle-community
2025-11-05 16:02:04 +08:00
committed by GitHub
3 changed files with 12 additions and 10 deletions

View File

@@ -345,8 +345,8 @@ func (s *Server) handleCreateTrader(c *gin.Context) {
// 设置扫描间隔默认值
scanIntervalMinutes := req.ScanIntervalMinutes
if scanIntervalMinutes <= 0 {
scanIntervalMinutes = 3 // 默认3分钟
if scanIntervalMinutes < 3 {
scanIntervalMinutes = 3 // 默认3分钟且不允许小于3
}
// ✨ 查询交易所实际余额,覆盖用户输入
@@ -527,6 +527,8 @@ func (s *Server) handleUpdateTrader(c *gin.Context) {
scanIntervalMinutes := req.ScanIntervalMinutes
if scanIntervalMinutes <= 0 {
scanIntervalMinutes = existingTrader.ScanIntervalMinutes // 保持原值
} else if scanIntervalMinutes < 3 {
scanIntervalMinutes = 3
}
// 更新交易员配置