This commit is contained in:
yanweidong
2026-02-03 22:42:47 +08:00
parent 35874406b3
commit 8e1b05fb42

View File

@@ -2,6 +2,7 @@ package strategy
import (
"log"
"sync"
"git.apinb.com/quant/gostock/internal/impl"
"git.apinb.com/quant/gostock/internal/models"
@@ -17,12 +18,19 @@ func BootAiStart(key string, ymd int) {
if err != nil {
panic(err)
}
var wg sync.WaitGroup
for _, row := range datas {
go BootAiTask(row.ID, row.Code)
wg.Add(1)
go BootAiTask(row.ID, row.Code, &wg)
}
wg.Wait()
}
func BootAiTask(id uint, code string) {
func BootAiTask(id uint, code string, wg *sync.WaitGroup) {
defer wg.Done()
result, err := AiAnalysis(code)
if err != nil {
log.Println("ERROR BootAiTask", err.Error())