|
|
|
@ -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 = 100 # tickers per yfinance bulk download
|
|
|
|
_PRICE_BATCH = 50 # tickers per yfinance bulk download (smaller = more responsive)
|
|
|
|
_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
|
|
|
|
|
|
|
|
|
|
|
|
@ -399,6 +399,8 @@ class UniverseService:
|
|
|
|
f"Universe: batch {batch_num}/{total_batches} — "
|
|
|
|
f"Universe: batch {batch_num}/{total_batches} — "
|
|
|
|
f"{len(batch)} tickers, {len(batch_rows)} snapshot rows"
|
|
|
|
f"{len(batch)} tickers, {len(batch_rows)} snapshot rows"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
# Yield to event loop between batches to keep API responsive
|
|
|
|
|
|
|
|
await asyncio.sleep(1)
|
|
|
|
|
|
|
|
|
|
|
|
logger.info(
|
|
|
|
logger.info(
|
|
|
|
f"Universe: build complete — {len(ticker_list)} tickers, "
|
|
|
|
f"Universe: build complete — {len(ticker_list)} tickers, "
|
|
|
|
|