fix: yfinance threads=False + 배치 30개로 OS 스레드 폭발 방지

threads=True일 때 배치당 50개 OS 스레드 생성 → 시스템 자원 고갈 → API 먹통.
threads=False로 순차 다운로드, 배치 30개로 축소.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
main
I Luk Kim 5 months ago
parent d4008924d9
commit 24736954bb

@ -30,7 +30,7 @@ from app.services.sec_http_client import SECHttpClient
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
_CHUNK = 3000 # asyncpg 32767-param limit (10 cols × 3000 = 30000) _CHUNK = 3000 # asyncpg 32767-param limit (10 cols × 3000 = 30000)
_PRICE_BATCH = 50 # tickers per yfinance bulk download (smaller = more responsive) _PRICE_BATCH = 30 # tickers per yfinance bulk download
_SEC_CONCURRENCY = 3 # concurrent SEC EDGAR companyfacts requests _SEC_CONCURRENCY = 3 # concurrent SEC EDGAR companyfacts requests
_SCREEN_PAGE = 250 # max per yf.screen() call _SCREEN_PAGE = 250 # max per yf.screen() call
@ -494,7 +494,7 @@ class UniverseService:
interval="1mo", interval="1mo",
auto_adjust=False, auto_adjust=False,
progress=False, progress=False,
threads=True, threads=False, # disable internal thread pool — prevents OS thread explosion
group_by="ticker", group_by="ticker",
) )
except Exception as e: except Exception as e:

Loading…
Cancel
Save