전략편집기 화면접속 시 에러 수정
This commit is contained in:
@@ -26,6 +26,8 @@ const CACHE_TTL_MS = 12_000;
|
||||
const ALL_CACHE_TTL_MS = 15_000;
|
||||
const UPBIT_COOLDOWN_MS = 45_000;
|
||||
const UPBIT_MIN_GAP_MS = 600;
|
||||
/** 프로덕션: 브라우저→업비트 직접 호출 금지(IP 429). 개발만 폴백 허용 */
|
||||
const ALLOW_UPBIT_DIRECT = import.meta.env.DEV;
|
||||
|
||||
function sleep(ms: number): Promise<void> {
|
||||
return new Promise(r => setTimeout(r, ms));
|
||||
@@ -172,6 +174,11 @@ async function fetchTickersCore(markets: string[]): Promise<UpbitTickerRaw[]> {
|
||||
}
|
||||
}
|
||||
|
||||
if (!ALLOW_UPBIT_DIRECT) {
|
||||
const stale = mergeStale(want);
|
||||
return stale.length > 0 ? stale : [];
|
||||
}
|
||||
|
||||
if (Date.now() < upbitCooldownUntil) {
|
||||
const stale = mergeStale(want);
|
||||
if (stale.length > 0) return stale;
|
||||
|
||||
Reference in New Issue
Block a user