This commit is contained in:
2026-02-27 13:26:22 +08:00
parent 4dde784047
commit fc5a1be7e1
8 changed files with 47 additions and 40 deletions

View File

@@ -16,7 +16,7 @@ func Boot() {
// 启动 AI 分析任务
func BootAiStart(key string, ymd int) error {
var datas []models.StratModel
err := impl.DBService.Where("strat_key=? and ymd=? and ai_score=0 and rsi_score>0 and macd_score>0", key, ymd).Find(&datas).Error
err := impl.DBService.Where("strat_key=? and ymd=? and status=2", key, ymd).Find(&datas).Error
if err != nil {
log.Printf("Failed to query data: %v", err)
return fmt.Errorf("query failed: %w", err)
@@ -25,8 +25,9 @@ func BootAiStart(key string, ymd int) error {
// 构造任务列表
var tasks []func()
for _, row := range datas {
r := row
tasks = append(tasks, func() {
BootAiTask(row.ID, row.Code)
BootAiTask(r.ID, r.Code)
})
}