Merge branch 'main' into feature/crawler

This commit is contained in:
skkim committed 2026-09-14 19:45:25 +09:00
commit dd3ad86715
160 files changed
+111240 -202

No files matched your search

+26 -1
View File
@@ -29,7 +29,16 @@ from common.logger import LOG
from common.utils.gtime import GTime
from crud.site_crud import SiteCRUD
from crud.place_crud import PlaceCRUD
from services import azure_static, indexnow, publish_gate, render_report, site_payload, site_thumbnail, song_service
from services import (
azure_static,
indexnow,
publish_gate,
render_report,
seo_keywords,
site_payload,
site_thumbnail,
song_service,
)
from services.local_content_service import LocalContentService
from services.site_payload import emit_payload
from services.snapshot import build_snapshot
@@ -157,6 +166,19 @@ async def run_build(job: dict) -> dict:
snapshot = await build_snapshot(place)
# ★ 메타 태그용 검색 키워드(SiteOntology). **스냅샷에 싣는다** — payload 는 스냅샷만 보고 만들고,
# "이 버전에 어떤 키워드가 나갔나" 가 site_versions.snapshot 에 남는다(services/seo_keywords 머리주석).
# ★ 실패해도 빌드는 계속한다. 주변 정보·노래와 같은 규칙이다 — 키워드 없이 예전 제목·메타로 나간다.
# ★ 재빌드(publish=False)에도 부른다. 로컬 임베딩이라 비용이 없고, 재빌드한 버전과 발행한 버전의
# 제목이 갈리면 "눌러 본 것과 나간 것이 다르다" 가 된다.
seo: dict | None = None
try:
seo = await seo_keywords.fetch(place_id, snapshot)
except Exception as ex: # noqa: BLE001 — 키워드 실패가 발행을 죽이면 안 된다
LOG.w(f"[build] place={place_id} 검색 키워드 실패(키워드 없이 발행): {type(ex).__name__}: {ex}")
if seo:
snapshot["seo"] = seo
v_err, version_no = await DB_SESSION_MNG.execute_lambda(
site_versions.DBType(), DBWRType.DB_READ.value, lambda s: _site_crud.next_version_no(s, site.site_id)
)
@@ -180,6 +202,9 @@ async def run_build(job: dict) -> dict:
# 잡 결과에 남긴다 — "노래가 왜 없나" 를 잡 하나만 열어 보면 알 수 있어야 한다.
if song_result is not None:
result["song"] = song_result
# "제목이 왜 예전 그대로인가" 도 같다 — 키워드가 실렸으면 잡 결과에 보인다(없으면 로그의 [seo] 줄).
if seo is not None:
result["seo"] = seo
now = GTime.UTC()
async def _fail(reason: str, gate: publish_gate.GateResult | None = None, extra: dict | None = None):