[feat] solution,postgres-init,docs: 생성 진행 상태 · 새로 만들기 존중 · 발행본 색인·파비콘
작업트리에 커밋되지 않은 채 쌓여 있던 것과, 오늘 찾은 문제 셋을 함께 담는다. ## 1. 콘텐츠 생성 진행 상태 (작업트리에 있던 것) COPY 잡의 실제 단계를 DB에 기록하고 응답으로 내보낸다. 폴링 횟수로 진행률을 흉내 내던 것을 걷어냈다. 새로고침·재접속해도 jobId 로 이어서 본다. - services/copy_steps.py · services/job_progress.py · common/job_errors.py (신규) - postgres-init/migrations/0013_job_progress.sql + init.sql - 프론트: useGenerationJob · generationLabels (신규), Step5Generating·pollJob 배선, orval 모델 갱신(jobProgress · jobStep · jobStepStatus · jobStepReason) - docs/GENERATION_FLOW.md (신규) ## 2. 발행된 사이트만 색인한다 실측(2026-09-15): 디스크의 발행본 33곳 중 **15곳이 draft 인데 `index, follow`** 였고 사이트맵에도 올라가 있었다. 사장님이 발행 버튼을 누른 적 없는 사이트가 짓다 만 상태로 구글에 실려 있었다는 뜻이다. head.ts 가 robots 를 하드코딩하고 payload 의 `site.status` 를 보지 않았다. "색인을 막을 이유가 없다"는 주석은 굽는 것이 곧 발행이던 시절의 말인데, 지금은 빌더 미리보기만 눌러도 draft 로 구워진다. - seo/head.ts: PUBLISHED 일 때만 index, 아니면 `noindex, follow` - 사이트맵·`/s` 목록·llms.txt 에서도 함께 빠진다 — 그쪽은 구운 HTML 의 robots 를 읽어 거른다(seo/directory.ts readBakedNoindex). 규칙을 두 자리에 두지 않으려고 한 곳에 뒀다 ## 3. [새로 크롤링하고 사이트 생성하기] 를 뒤집지 않는다ba90a19의 중복 합치기가 **일부러 다시 만들려는 경우까지** 기존 사업장으로 끌고 갔다 — 새로 만들기를 눌렀는데 기존 에디터가 열린다(사장님 보고 2026-09-15). - Req_VerifyPlaceByUrl.reuse_existing (기본 True — 다른 호출자의 동작은 그대로) - place_service.verify_place_by_url: 끄면 이어붙이지 않는다. 다만 **비어 있는 중복 행은 계속 치운다** — 원래 막으려던 누적이 그것이고 빈 행은 잃을 것이 없다 - ensureServerPlace: 위저드는 새로 만들기 경로에서만 오므로 False 로 보낸다 ## 4. 발행본 파비콘 발행본에 파비콘 링크가 아예 없어 브라우저 탭에 기본 아이콘이 떴다. 파일은 오리진 루트의 공용 자산이라 사이트마다 복사하지 않고 루트 절대경로로 가리킨다. 검증: site vitest 84건 통과 · tsc(site·frontend) · eslint 통과. 백엔드 pytest 는 로컬 DB 비밀번호가 맞지 않아 돌리지 못했다(a5b8701과 같은 자리). 발행본 반영에는 전체 재굽기가 필요하다. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
4cd756108d
commit
079c93a62a
60 files changed
+1465
-596
No files matched your search
@@ -295,28 +295,55 @@ class PlaceService:
|
||||
sess, uuid.UUID(user_info.user_id), ExternalPlaceSource.NAVER.value, str(naver_id),
|
||||
),
|
||||
)
|
||||
canonical_id = place_id
|
||||
#
|
||||
# ★ **사장님이 새로 만들겠다고 누른 것은 뒤집지 않는다** (2026-09-15)
|
||||
# 위 합치기는 "위저드를 다시 시작하면 빈 행이 쌓인다" 를 막으려던 것인데,
|
||||
# [새로 크롤링하고 사이트 생성하기] 와 구분이 없어서 **일부러 다시 만들려는 경우도
|
||||
# 기존 사업장으로 끌고 갔다** — 새로 만들기를 눌렀는데 기존 에디터가 열린다.
|
||||
# 그래서 이어붙이기는 `reuse_existing` 이 켜져 있을 때만 한다.
|
||||
#
|
||||
# 끄더라도 **비어 있는 중복 행은 치운다.** 원래 막으려던 누적이 그것이고,
|
||||
# 빈 행은 잃을 것이 없다. 지금 행은 앞으로 채워질 것이므로 대상이 아니다.
|
||||
others = []
|
||||
if err_dup == ErrorType.SUCCESS:
|
||||
existing = next((r for r in (dup_rows or []) if str(r.place_id) != str(place_id)), None)
|
||||
if existing is not None:
|
||||
canonical_id = str(existing.place_id)
|
||||
if await self._is_empty(place_id):
|
||||
others = [r for r in (dup_rows or []) if str(r.place_id) != str(place_id)]
|
||||
|
||||
if others and not req.reuse_existing:
|
||||
for row in others:
|
||||
if await self._is_empty(str(row.place_id)):
|
||||
await DB_SESSION_MNG.execute_lambda_claim(
|
||||
places.DBType(),
|
||||
lambda sess: self.crud.delete_place(
|
||||
sess, uuid.UUID(user_info.user_id), uuid.UUID(place_id),
|
||||
lambda sess, rid=row.place_id: self.crud.delete_place(
|
||||
sess, uuid.UUID(user_info.user_id), rid,
|
||||
),
|
||||
)
|
||||
LOG.i(f"[verify_by_url] 같은 업소가 이미 있다 — 빈 행 {place_id} 를 접고 "
|
||||
f"{canonical_id} 로 잇는다 (naver {naver_id})")
|
||||
else:
|
||||
LOG.w(f"[verify_by_url] 같은 업소가 둘이다 — {place_id} 에 쌓인 것이 있어 "
|
||||
f"지우지 않는다. 정본 {canonical_id} 를 돌려준다 (naver {naver_id})")
|
||||
place_id = canonical_id
|
||||
err_type, place = await self._load(user_info, place_id)
|
||||
if err_type != ErrorType.SUCCESS:
|
||||
res.result.SetResult(err_type)
|
||||
return res
|
||||
LOG.i(f"[verify_by_url] 새로 만들기 — 빈 중복 행 {row.place_id} 를 치운다 "
|
||||
f"(naver {naver_id})")
|
||||
LOG.i(f"[verify_by_url] 새로 만들기 — 같은 업소가 {len(others)}개 있지만 "
|
||||
f"{place_id} 로 새로 간다 (naver {naver_id})")
|
||||
others = []
|
||||
|
||||
canonical_id = place_id
|
||||
if others:
|
||||
existing = others[0]
|
||||
canonical_id = str(existing.place_id)
|
||||
if await self._is_empty(place_id):
|
||||
await DB_SESSION_MNG.execute_lambda_claim(
|
||||
places.DBType(),
|
||||
lambda sess: self.crud.delete_place(
|
||||
sess, uuid.UUID(user_info.user_id), uuid.UUID(place_id),
|
||||
),
|
||||
)
|
||||
LOG.i(f"[verify_by_url] 같은 업소가 이미 있다 — 빈 행 {place_id} 를 접고 "
|
||||
f"{canonical_id} 로 잇는다 (naver {naver_id})")
|
||||
else:
|
||||
LOG.w(f"[verify_by_url] 같은 업소가 둘이다 — {place_id} 에 쌓인 것이 있어 "
|
||||
f"지우지 않는다. 정본 {canonical_id} 를 돌려준다 (naver {naver_id})")
|
||||
place_id = canonical_id
|
||||
err_type, place = await self._load(user_info, place_id)
|
||||
if err_type != ErrorType.SUCCESS:
|
||||
res.result.SetResult(err_type)
|
||||
return res
|
||||
|
||||
coord = base.get("coordinate") or {}
|
||||
verify_req = Req_VerifyPlace(
|
||||
@@ -919,6 +946,15 @@ class PlaceService:
|
||||
res.result.SetResult(err_type)
|
||||
return res
|
||||
|
||||
# URL 에 잡 ID 를 쓰기 전에 응답이 끊겨도 완료된 작업을 다시 만들지 않는다.
|
||||
if req.resume:
|
||||
existing = await self.queue.find_latest(f"copy:{place_id}")
|
||||
if existing:
|
||||
res.job_id = uuid.UUID(existing["job_id"])
|
||||
res.status = JobStatus(existing["status"])
|
||||
res.created = False
|
||||
return res
|
||||
|
||||
crud = FactCRUD()
|
||||
f_err, rows = await DB_SESSION_MNG.execute_lambda(
|
||||
facts_model.DBType(),
|
||||
|
||||
Reference in new issue
Block a user