알림목록 전략지표 없음 문제 수정
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { loadStrategyTimeframes, pinCandleWatch, repairStrategyTimeframes } from './backendApi';
|
||||
import { loadStrategyTimeframes, pinCandleWatch, repairStrategyTimeframes, type StrategyDto } from './backendApi';
|
||||
import { normalizeStartCandleType } from './strategyStartNodes';
|
||||
import { syncStrategyTimeframesFromLayoutIfNeeded } from './strategyTimeframeSync';
|
||||
import { collectUiEvaluationTimeframes, syncStrategyTimeframesFromLayoutIfNeeded } from './strategyTimeframeSync';
|
||||
|
||||
/** 전략 DSL 평가 분봉 전체 pin — 1m 집계·상위 봉 warm-up */
|
||||
export async function pinStrategyEvaluationTimeframes(
|
||||
@@ -22,3 +22,30 @@ export async function pinStrategyEvaluationTimeframes(
|
||||
}
|
||||
return timeframes;
|
||||
}
|
||||
|
||||
/** 알림 목록 — DB sync/repair 없이 평가 분봉만 pin (서버 read-only 안전) */
|
||||
export async function pinReadOnlyStrategyTimeframes(
|
||||
market: string,
|
||||
strategyId: number,
|
||||
strategy?: StrategyDto,
|
||||
): Promise<void> {
|
||||
let timeframes: string[] = [];
|
||||
try {
|
||||
timeframes = collectUiEvaluationTimeframes(strategyId, strategy);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
if (timeframes.length === 0) {
|
||||
try {
|
||||
const raw = await loadStrategyTimeframes(strategyId);
|
||||
timeframes = raw.length ? raw : ['1m'];
|
||||
} catch {
|
||||
timeframes = ['1m'];
|
||||
}
|
||||
}
|
||||
const unique = [...new Set(timeframes.map(tf => normalizeStartCandleType(tf)))];
|
||||
if (!unique.includes('1m')) unique.unshift('1m');
|
||||
for (const tf of unique) {
|
||||
await pinCandleWatch(market, tf);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user