mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-07 13:00:59 +08:00
Merge pull request #493 from simonjiang99/fix/3-minutes-minimum
fix(api):enforce minimum scan interval of three minutes
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
// 更新交易员配置
|
||||
|
||||
Reference in New Issue
Block a user