[fix] solution: 온보딩 생성·크롤링 진단·장애 알림 묶음
운영 번들 자동 로그인 자격증명 유출, 온보딩 COPY 잡이 Gemini 429 로 죽던 것, 크롤링 실패가 로그에만 남던 것을 한 번에 정리한다. 실측(2026-09-15 밤, 킹서버): 사진분석 배치가 Gemini 분당 쿼터를 다 써서 같은 키를 쓰는 온보딩 COPY 잡도 같이 429 를 맞고 DEAD 로 갔다 — 확인된 fact 만으로도 편집·발행이 되는데 잡을 죽일 이유가 없었다. - solution/frontend: `VITE_AUTO_LOGIN_ID`·`PW` 를 운영 진입점에 안 넘긴다(자동 로그인은 dev 서버 전용) + `Step5Generating` 겉모습을 이전 카드 스타일로, 데이터는 실제 잡 진행(useGenerationJob) 그대로 - solution/backend: copy_service — Gemini 호출 실패해도 잡을 안 죽이고 fact 만으로 계속. db_session_manager — 유니크 제약 충돌(정상 경로) 로그를 ERROR → WARN. worker/runner + alert_service + teams_webhook — 잡 dead-letter·발행 실패·큐 정체를 Teams 로 알림(영구 저장 + 재시도 + dedupe). `/readyz` 추가. collect_diagnostics(신규) — 크롤링 채널별 실패를 jobs.result 에 구조화해서 싣는다. - postgres-init: 0015(users token_version) · 0016(alert_outbox) 마이그레이션 검증: 백엔드 pytest 759 passed. tsc(solution/frontend) 통과. Teams 알림 실채널 수신 확인.
This commit is contained in:
1 parent
b76144746b
commit
b4085a0e0f
36 files changed
+1320
-84
No files matched your search
@@ -173,9 +173,12 @@ class JobQueue:
|
||||
|
||||
return await self._tx(run)
|
||||
|
||||
async def reap(self) -> list[str]:
|
||||
async def reap(self) -> list[dict]:
|
||||
"""만료된 lease(워커 사망 등)의 RUNNING 잡을 회수. 시도 남으면 즉시 재큐, 소진되면 DEAD.
|
||||
회수된 job_id 목록 반환."""
|
||||
|
||||
회수된 잡마다 {job_id, job_type, status, last_error} 를 돌려준다 — worker/runner.py 의
|
||||
run_reaper 가 이 중 DEAD(4) 로 떨어진 것만 골라 알린다(alert_service). job_id 목록만
|
||||
돌려주던 예전 모양보다 한 겹 더 있는 이유가 그것뿐이다."""
|
||||
sql = text("""
|
||||
UPDATE jobs SET
|
||||
status = CASE WHEN attempts >= max_attempts THEN 4 ELSE 1 END,
|
||||
@@ -185,12 +188,15 @@ class JobQueue:
|
||||
worker_id = NULL,
|
||||
updated_at = now()
|
||||
WHERE status = 2 AND lease_until IS NOT NULL AND lease_until < now()
|
||||
RETURNING job_id
|
||||
RETURNING job_id, job_type, status, last_error
|
||||
""")
|
||||
|
||||
async def run(s):
|
||||
rows = (await s.execute(sql)).all()
|
||||
return [str(r[0]) for r in rows]
|
||||
return [
|
||||
{"job_id": str(r[0]), "job_type": r[1], "status": r[2], "last_error": r[3]}
|
||||
for r in rows
|
||||
]
|
||||
|
||||
return await self._tx(run)
|
||||
|
||||
|
||||
Reference in new issue
Block a user