Merge branch 'fix/coupang-error-span'
This commit is contained in:
@@ -331,9 +331,12 @@ class CoupangAdapter(MarketplaceAdapter):
|
||||
out: list[dict[str, Any]] = []
|
||||
for a, b in spans(start - timedelta(days=1), end, ORDER_SPAN_DAYS):
|
||||
for st in STATUSES:
|
||||
rows = self._pages(ctx, path, {"createdAtFrom": f"{a.isoformat()}+09:00",
|
||||
"createdAtTo": f"{b.isoformat()}+09:00",
|
||||
"status": st, "maxPerPage": PAGE_SIZE})
|
||||
try:
|
||||
rows = self._pages(ctx, path, {"createdAtFrom": f"{a.isoformat()}+09:00",
|
||||
"createdAtTo": f"{b.isoformat()}+09:00",
|
||||
"status": st, "maxPerPage": PAGE_SIZE})
|
||||
except ApiError as exc: # 긴 기간을 나눠 부를 때 어느 구간에서 막혔는지 알 수 있게
|
||||
raise ApiError(f"{exc.message} [주문일 {a.isoformat()}~{b.isoformat()}, 상태 {st}]") from None
|
||||
out.extend(rows)
|
||||
ctx.progress.step(items=len(rows))
|
||||
return out
|
||||
@@ -342,7 +345,11 @@ class CoupangAdapter(MarketplaceAdapter):
|
||||
path = RG_ORDERS_PATH.format(vendor=self._vendor(ctx))
|
||||
out: list[dict[str, Any]] = []
|
||||
for a, b in spans(start, end, RG_SPAN_DAYS):
|
||||
rows = self._pages(ctx, path, {"paidDateFrom": a.strftime("%Y%m%d"), "paidDateTo": b.strftime("%Y%m%d")}, rg=True)
|
||||
try:
|
||||
rows = self._pages(ctx, path, {"paidDateFrom": a.strftime("%Y%m%d"), "paidDateTo": b.strftime("%Y%m%d")},
|
||||
rg=True)
|
||||
except ApiError as exc:
|
||||
raise ApiError(f"{exc.message} [로켓그로스 결제일 {a.isoformat()}~{b.isoformat()}]") from None
|
||||
out.extend(rows)
|
||||
ctx.progress.step(items=len(rows))
|
||||
return out
|
||||
|
||||
Reference in New Issue
Block a user