MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / fetchHead

Function fetchHead

packages/trigger-sdk/src/apiClient.ts:953–974  ·  view source on GitHub ↗
(
  url: string,
  requestInitWithoutMethod?: Omit<RequestInit, "method">,
  retryCount = 0
)

Source from the content-addressed store, hash-verified

951}
952
953async function fetchHead(
954 url: string,
955 requestInitWithoutMethod?: Omit<RequestInit, "method">,
956 retryCount = 0
957): Promise<Response> {
958 const requestInit: RequestInit = {
959 ...requestInitWithoutMethod,
960 method: "HEAD",
961 };
962 const response = await fetch(url, requestInitWithCache(requestInit));
963
964 if (response.status >= 500 && retryCount < MAX_RETRIES) {
965 // retry with exponential backoff and jitter
966 const delay = exponentialBackoff(retryCount + 1);
967
968 await new Promise((resolve) => setTimeout(resolve, delay));
969
970 return fetchHead(url, requestInitWithoutMethod, retryCount + 1);
971 }
972
973 return response;
974}
975
976async function zodfetch<TResponseSchema extends z.ZodTypeAny, TOptional extends boolean = false>(
977 schema: TResponseSchema,

Callers 1

#queryKeyValueStoreMethod · 0.85

Calls 3

requestInitWithCacheFunction · 0.70
exponentialBackoffFunction · 0.70
fetchFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…