@yoonion/mimi-seed-mcp 0.15.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/http.js +9 -1
- package/package.json +1 -1
package/dist/lib/http.js
CHANGED
|
@@ -37,6 +37,14 @@ const MAX_BACKOFF_MS = 20_000;
|
|
|
37
37
|
const RETRY_WINDOW_MS = 30_000;
|
|
38
38
|
/** 예산이 거의 소진돼도 최소한 이만큼은 준다 — 0초 타임아웃으로 즉시 죽는 것을 막는다. */
|
|
39
39
|
const MIN_ATTEMPT_MS = 1_000;
|
|
40
|
+
/**
|
|
41
|
+
* 재시도 사이 최소 간격.
|
|
42
|
+
*
|
|
43
|
+
* `Retry-After: 0`(또는 이미 지난 HTTP-date)은 합법이지만 그대로 따르면 **지연 없이**
|
|
44
|
+
* 재요청하게 된다 — 방금 "속도 제한 중"이라고 답한 서버에 연타를 넣는 꼴이고, 대기가
|
|
45
|
+
* 0이면 벽시계가 흐르지 않아 총 예산 검사도 무력해진다.
|
|
46
|
+
*/
|
|
47
|
+
const MIN_RETRY_DELAY_MS = 250;
|
|
40
48
|
/**
|
|
41
49
|
* 메서드가 재요청해도 안전한가(RFC 9110 idempotent).
|
|
42
50
|
*
|
|
@@ -174,7 +182,7 @@ export async function fetchWithTimeout(input, init = {}, options = {}) {
|
|
|
174
182
|
return response;
|
|
175
183
|
if (!hasBudget(attempt + 1))
|
|
176
184
|
return response;
|
|
177
|
-
const wait = parseRetryAfter(response.headers.get('retry-after'), Date.now()) ?? backoffFor(attempt);
|
|
185
|
+
const wait = Math.max(parseRetryAfter(response.headers.get('retry-after'), Date.now()) ?? backoffFor(attempt), MIN_RETRY_DELAY_MS);
|
|
178
186
|
// 재시도할 응답의 본문은 읽지 않고 버린다 — 소켓을 붙잡고 있지 않도록.
|
|
179
187
|
await response.body?.cancel().catch(() => undefined);
|
|
180
188
|
await sleep(cappedWait(wait, deadline));
|
package/package.json
CHANGED