mirror of
https://ghfast.top/https://github.com/aeroxw/tick-stock-panel.git
synced 2026-09-12 14:24:15 +08:00
feat(frontend): 自选分时请求带 prefer_local, 策略页行为不变
- klineMinuteBatch 加 preferLocal 参数, 响应类型补 full_minute_local - 仅 Watchlist 分时轮询传 true (全量分钟健康时股票不走批量补拉); Screener 不传, 严格限定本轮只辐射自选场景
This commit is contained in:
@@ -2052,10 +2052,10 @@ export const api = {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ symbols, days }),
|
||||
}),
|
||||
klineMinuteBatch: (symbols: string[], date?: string) =>
|
||||
request<{ data: Record<string, MinuteKlineRow[]> }>('/api/kline/minute-batch', {
|
||||
klineMinuteBatch: (symbols: string[], date?: string, preferLocal?: boolean) =>
|
||||
request<{ data: Record<string, MinuteKlineRow[]>; full_minute_local?: boolean }>('/api/kline/minute-batch', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ symbols, date }),
|
||||
body: JSON.stringify({ symbols, date, ...(preferLocal ? { prefer_local: true } : {}) }),
|
||||
}),
|
||||
instrumentSearch: (q: string, limit = 20, assetTypes?: string) =>
|
||||
request<{ results: { symbol: string; name: string; code: string; asset_type?: string }[] }>(
|
||||
|
||||
@@ -880,7 +880,9 @@ export function Watchlist() {
|
||||
const intradayRefreshInterval = prefsData?.minute_intraday_refresh_interval ?? 6
|
||||
const minuteBatch = useQuery({
|
||||
queryKey: QK.minuteBatch(minuteSymbolsKey),
|
||||
queryFn: () => api.klineMinuteBatch(minuteSymbols),
|
||||
// prefer_local: 全量分钟服务健康时股票缺口不再批量补拉 (本地分区由服务持续写入),
|
||||
// 大自选(数百上千只)不再持续打批量分钟接口
|
||||
queryFn: () => api.klineMinuteBatch(minuteSymbols, undefined, true),
|
||||
enabled: intradayVisible && minuteSymbols.length > 0 && !groupCardsOpen,
|
||||
staleTime: 10_000,
|
||||
refetchInterval: (intradayRefreshEnabled && realtimeRunning) ? intradayRefreshInterval * 1000 : false,
|
||||
|
||||
Reference in New Issue
Block a user