refactor: extract utils to fix circular import and enable smart generator

This commit is contained in:
2026-01-26 01:21:57 +09:00
parent 526d6a53e5
commit 421e52b205
3 changed files with 62 additions and 59 deletions

View File

@@ -4,7 +4,7 @@ from typing import Dict, Any, List, Optional
from .db import _conn, save_recommendation_dedup, get_latest_draw, get_all_draw_numbers
from .recommender import recommend_numbers
from .main import calc_metrics, calc_recent_overlap # main에 있는 헬퍼 재사용(순환참조 주의 필요 -> 사실 헬퍼는 utils로 빼는게 좋으나 일단 진행)
from .utils import calc_metrics, calc_recent_overlap
# 순환 참조 방지를 위해 main.py의 calc_metrics 등을 utils.py가 아닌 여기서 재정의하거나
# main.py에서 generator를 import할 때 함수 내부에서 하도록 처리.