We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e7ac5e3 + df7a6d8 commit 1131594Copy full SHA for 1131594
1 file changed
lib/github.ts
@@ -21,15 +21,15 @@ const REST_TIMEOUT_MS = 5000; // 5s for REST endpoints
21
22
// Retry delay uses exponential backoff: delay = BASE_DELAY_MS * 2^attempt.
23
export async function fetchWithRetry(
24
- url: string,
+ url: string | URL,
25
options: RequestInit,
26
attempt = 0,
27
timeoutMs?: number
28
): Promise<Response> {
29
// Determine default timeout based on endpoint type if not explicitly provided.
30
// GraphQL calls carry a larger payload and need a slightly longer window.
31
const resolvedTimeout =
32
- timeoutMs ?? (url.includes('graphql') ? GRAPHQL_TIMEOUT_MS : REST_TIMEOUT_MS);
+ timeoutMs ?? (url.toString().includes('graphql') ? GRAPHQL_TIMEOUT_MS : REST_TIMEOUT_MS);
33
34
if (options.signal?.aborted) {
35
throw new Error('AbortError');
0 commit comments