From 8411e2c73e8c64602b5754c0afd4fa646af6a4a3 Mon Sep 17 00:00:00 2001 From: gahusb Date: Fri, 1 May 2026 10:32:58 +0900 Subject: [PATCH] =?UTF-8?q?feat(realestate):=20=EA=B2=B0=EA=B3=BC=EB=B0=9C?= =?UTF-8?q?=ED=91=9C=20=EA=B3=B5=EA=B3=A0=20=EB=A7=A4=EC=B9=AD=20=EC=A0=90?= =?UTF-8?q?=EC=88=98=20=EB=B3=B4=EC=A1=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit run_matching() 대상을 '청약예정/청약중/결과발표'로 확장. 삭제는 '완료' 상태만 — 결과발표 단계의 매칭 기록은 유지. Co-Authored-By: Claude Sonnet 4.6 --- realestate-lab/app/matcher.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/realestate-lab/app/matcher.py b/realestate-lab/app/matcher.py index 5a9839e..353a34f 100644 --- a/realestate-lab/app/matcher.py +++ b/realestate-lab/app/matcher.py @@ -205,7 +205,7 @@ def run_matching(): profile = _profile_row_to_dict(profile_row) anns = conn.execute( - "SELECT * FROM announcements WHERE status IN ('청약예정', '청약중')" + "SELECT * FROM announcements WHERE status IN ('청약예정', '청약중', '결과발표')" ).fetchall() for ann_row in anns: @@ -235,10 +235,10 @@ def run_matching(): json.dumps(result["score_breakdown"]), )) - # Clean up stale match results for completed announcements + # 완료 상태 공고의 매칭 결과만 삭제 (결과발표는 보존) conn.execute( - "DELETE FROM match_results WHERE announcement_id NOT IN " - "(SELECT id FROM announcements WHERE status IN ('청약예정', '청약중'))" + "DELETE FROM match_results WHERE announcement_id IN " + "(SELECT id FROM announcements WHERE status = '완료')" ) logger.info("매칭 완료")