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