You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
I Luk Kim c203f3920b refactor: session-per-phase — DB 커넥션을 외부 API 호출 중 해제
서비스 메서드가 db: AsyncSession을 인자로 받아 외부 API 호출(yfinance 30-60s,
Alpaca HTTP) 중에도 DB 커넥션을 잡고 있던 구조를 제거.

변경 패턴 (Session-per-phase):
  Before: Endpoint(db) → Service(db) → DB check → API call(30s 세션 유지) → DB store
  After:  Endpoint()   → Service()   → DB check(세션1) → API call(세션 없음) → DB store(세션2)

변경 파일:
- alpaca_price_service.py: fetch_and_store_bars, get_or_fetch_multi_bars에서 db 제거
- price_data_service.py: get_or_update_price_data, get_multiple_tickers_data_optimized에서
  db 제거; _fetch_price_data(새), _bulk_fetch_price_data(새, lambda 클로저 버그 수정);
  _fetch_and_store_price_data, _bulk_fetch_and_store_price_data, get_multiple_tickers_data 제거
- alpaca.py, price.py: Depends(get_db) 제거 (GET /latest 제외)
- financial_service.py, real_sec_financial_service.py: 호출 인자 정리

결과: "idle in transaction" 커넥션 0개, 풀 고갈 원인 근본 해결

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
4 months ago
..
__init__.py Initial commit with full project improvements 5 months ago
alpaca.py refactor: session-per-phase — DB 커넥션을 외부 API 호출 중 해제 4 months ago
attention.py perf: API 성능 개선 Round 2 — 9개 항목 (P6-P14) 5 months ago
catalog.py Initial commit with full project improvements 5 months ago
database.py fix(overlay): 다중 버그 수정 및 OpenAPI 문서 개선 5 months ago
dividends.py feat: PIT dividend calendar + earnings surprise calendar endpoint 4 months ago
earnings.py feat: PIT dividend calendar + earnings surprise calendar endpoint 4 months ago
error_logs.py chore: remove SQLite entirely, PostgreSQL only 5 months ago
etf.py fix(overlay): 다중 버그 수정 및 OpenAPI 문서 개선 5 months ago
filings.py feat: 8-K 재파싱 지원 — force_reparse + 단일 accession 재처리 endpoint 4 months ago
financial.py perf: API 성능 개선 — 로그 분석 기반 6개 항목 수정 5 months ago
finra.py feat: Form 4 내부자 거래 + Earnings Surprise + FINRA 확장 5 months ago
fred.py fix(overlay): 다중 버그 수정 및 OpenAPI 문서 개선 5 months ago
health.py Codebase improvements: caching decorator, Pydantic v2, DB indexes, connection pooling, Alembic 5 months ago
insider.py feat: Earnings Surprise를 SEC XBRL로 전환 + Insider/FINRA 과거 데이터 확장 5 months ago
migration.py Initial commit with full project improvements 5 months ago
news.py fix(overlay): 다중 버그 수정 및 OpenAPI 문서 개선 5 months ago
overlay.py fix(overlay): 다중 버그 수정 및 OpenAPI 문서 개선 5 months ago
price.py refactor: session-per-phase — DB 커넥션을 외부 API 호출 중 해제 4 months ago
request_logs.py perf: API 성능 개선 Round 3 — 8개 항목 (P15-P22) 5 months ago
screener.py fix(overlay): 다중 버그 수정 및 OpenAPI 문서 개선 5 months ago
stocks.py docs: 데이터 보유 범위 및 백필 가이드 추가 5 months ago
universe.py fix: isolated thread에 독립적인 DB 엔진 생성 5 months ago