fix(stock): 统计涨跌时过滤真停牌股,同步日志记录拉取数量

This commit is contained in:
2026-07-04 11:11:28 +08:00
parent 2d967f21ec
commit 1453088c0b
2 changed files with 11 additions and 5 deletions
+4
View File
@@ -3,6 +3,7 @@ package services
import (
"context"
"fmt"
"log"
"sync"
"time"
@@ -87,6 +88,9 @@ func (s *StockSyncService) doSync(ctx context.Context) (int, error) {
return 0, fmt.Errorf("no quotes returned")
}
log.Printf("[stock sync] fetched %d stock quotes from CN_Equity_A, %d index quotes, total %d",
len(stockQuotes), len(indexQuotes), len(quotes))
// 3. 归一化并写入 DB
records := make([]models.StockDailyQuote, 0, len(quotes))
for _, q := range quotes {