fix(performance): coupang 504 timeouts shrink the query window instead of failing
A 31-day FINAL_DELIVERY ordersheet query times out at Coupang's gateway (504 "Request timed out"). On 502/503/504 or a client timeout the window is halved (31 -> 15 -> 7 -> 3 -> 1 day) and retried; the shrunk size is kept for the same status's next windows. Rocket Growth orders do the same. A 1-day window that still times out is retried twice (3s, 6s) then fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -184,6 +184,10 @@
|
||||
- 정산 줄의 다른 항목: 셀러 부담 쿠폰 `shoppingDiscountMerchant`, 정산 지급액 `settlementAmount`, 수수료 `payFee`·`productFee`.
|
||||
|
||||
### 쿠팡 (`adapters/coupang.py`, 구현됨 — 규칙 대조 전)
|
||||
- **시간 초과 대응**(2026-10-13): 31일치 배송완료(FINAL_DELIVERY) 발주서처럼 건수가 많으면 쿠팡 게이트웨이가
|
||||
504 "Request timed out" 을 낸다. 502·503·504·응답 시간 초과(`GatewayTimeout`)면 그 구간을 반으로(31→15→7→3→1일) 줄여 다시 부르고,
|
||||
줄인 크기는 같은 상태의 다음 구간에도 쓴다(로켓그로스도 같은 방식). 하루 구간도 계속 시간 초과면 3·6초 쉬고 2번 더 부른 뒤 실패.
|
||||
오류 문구 끝에 실패한 구간·상태 `[주문일 …~…, 상태 …]` 를 붙인다.
|
||||
|
||||
- 맞출 화면(2026-10-12 사용자 지정): WING → 비즈니스 인사이트 → **판매분석**, 판매자배송 + 로켓그로스, 날짜 선택 → **매출(원)**.
|
||||
판매분석 자체를 주는 Open API 는 없다(developers.coupang.com API 목록 확인) → 주문 API 두 개를 **결제일(한국 시간)** 로 합친다.
|
||||
|
||||
Reference in New Issue
Block a user