fix(realestate-lab): 매칭 재계산 DB lock 오류 수정

- sqlite3.connect timeout=10 추가 (기본 0초 → 즉시 실패 방지)
- run_matching() 단일 connection으로 통합 (프로필 조회~매칭~저장)
- matches/refresh 엔드포인트 에러 핸들링 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-07 04:51:06 +09:00
parent 535ffea45a
commit 011eac7682
3 changed files with 16 additions and 9 deletions

View File

@@ -159,7 +159,11 @@ def api_matches(page: int = Query(1, ge=1), size: int = Query(20, ge=1, le=100))
@app.post("/api/realestate/matches/refresh")
def api_matches_refresh():
run_matching()
try:
run_matching()
except Exception as e:
logger.exception("매칭 실행 실패")
raise HTTPException(status_code=500, detail=str(e))
return {"ok": True}