Open voting for all groups by D-2 time + 30h-ahead AI gen; misc fixes
- domain: is_votable → all groups (voting gated by D-2 open ~ kickoff-60m time window, not group) - worker: AI generation selects matches by opens_at <= now+lookahead (all groups), pre-fills before D-2 open so picks aren't empty; only_missing keeps total calls = 3/match - config: ai_generate_lookahead_hours=30 (covers daily-only gen cadence) - Arena: default pick 0:0 (무승부) - frontend Dockerfile: install from package.json only (macOS-generated lock leaves rollup darwin-x64 stub w/o version → npm "Invalid Version" on linux) NOTE for deploy: set DEMO_FORCE_OPEN=false and real PUBLIC_ORIGIN in server .env. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
deb1332440
commit
955ffae4cf
5 files changed
+21
-14
No files matched your search
@@ -83,17 +83,18 @@ async def generate_ai_predictions(only_missing: bool = True) -> None:
|
||||
only_missing=False: 전부 재생성(덮어쓰기) — 수동 재생성 스크립트용.
|
||||
"""
|
||||
async with SessionLocal() as db:
|
||||
# AI 예측·투표 대상 조(featured_group)만 생성. 그 외 조는 일정/결과만.
|
||||
matches = (
|
||||
# 투표 오픈(킥오프 D-2)이 임박/도래한 미종료 경기 — 조 무관.
|
||||
# lookahead_hours 만큼 선행 생성해 다음 생성 주기 전에 오픈할 경기도 미리 채운다
|
||||
# (1일 1회 생성 → 오픈 시점에 AI 가 비어 보이지 않도록). 더 먼 미래 경기는 제외.
|
||||
horizon = now_utc() + timedelta(hours=settings.ai_generate_lookahead_hours)
|
||||
rows = (
|
||||
await db.execute(
|
||||
select(Match)
|
||||
.where(
|
||||
Match.result_outcome.is_(None),
|
||||
Match.group == settings.featured_group,
|
||||
)
|
||||
.where(Match.result_outcome.is_(None))
|
||||
.options(selectinload(Match.predictions))
|
||||
)
|
||||
).scalars().all()
|
||||
matches = [m for m in rows if ensure_aware(m.opens_at) <= horizon]
|
||||
|
||||
for m in matches:
|
||||
ctx = MatchContext(
|
||||
|
||||
Reference in new issue
Block a user