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("매칭 완료")