feat(negodata): LPS 최저가 동기화 배치 — 요청(API)·수집(lps_db)·반영(items)
설계(2026-07-10 결정): 요청은 LPS API(dedupe·워커알림 보존), 결과는 lps_db.price_history 직접 읽기(읽기전용 엔진). product_code=item_id 로 결과가 자동 매핑된다. - 잡③ request_lps_searches(매일 04:00 KST): 24h 이상 미수집 상품을 최대 500건 enqueue(job_type=batch, 100건/콜 청크) — 비용 발생 잡 - 잡④ sync_lps_results(5분): 워터마크(max crawl_end_time) 증분 수집 → item_internet_lowest_prices append(성공/실패 모두) + 성공분 최신값 items.internet_lowest_price 박제(+yn). 한 트랜잭션(부분반영 방지) - 스캔 바닥 3일 — 비uuid·미존재 상품 행이 워터마크를 못 올려도 재스캔 범위 유한 - ⚠️ 시각은 aware UTC 통일 — naive 를 timestamptz 파라미터로 넘기면 PG 세션 타임존(KST) 해석으로 9시간 어긋남(중복 수집 실측 버그 수정) - LowestPriceWebsite 코드 enum(naver=1 coupang=2 …), iilp ORM 모델, lps_base_url config(+LPS_BASE_URL env) 검증: 실상품 1건 e2e(요청→크롤 found 15,000원→이력+박제 반영), 멱등성(재실행 빈 카운터), 비uuid 12건 스킵, 대상선정 쿼리 500건 상한 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9e9de52200
commit
523661e3d2
8 files changed
+416
-1
No files matched your search
@@ -10,6 +10,7 @@ class WebServerConfig(ConfigModel):
|
||||
client_url: str = ""
|
||||
nego_chat_url: str = "http://localhost:3300"
|
||||
agent_base_url: str = "http://localhost:9500" # 협상 agent(9500). 공용 카탈로그 변경 알림용.
|
||||
lps_base_url: str = "http://localhost:9600" # 인터넷 최저가 검색 LPS(9600). 검색요청 enqueue 용.
|
||||
|
||||
|
||||
class LogConfig(ConfigModel):
|
||||
|
||||
@@ -59,3 +59,7 @@ def _apply_lps_db_env_override(cfg: LpsDBConfig):
|
||||
|
||||
|
||||
_apply_lps_db_env_override(lps_db_config)
|
||||
|
||||
# LPS API 주소 env override (도커: http://lps-api:9600 또는 host.docker.internal:9600)
|
||||
if os.environ.get("LPS_BASE_URL"):
|
||||
web_server_config.lps_base_url = os.environ["LPS_BASE_URL"]
|
||||
Reference in new issue
Block a user