MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / fetchWithTimeout

Function fetchWithTimeout

apps/kimi-code/src/cli/update/cdn.ts:36–46  ·  view source on GitHub ↗
(fetchImpl: typeof fetch, input: string)

Source from the content-addressed store, hash-verified

34}
35
36async function fetchWithTimeout(fetchImpl: typeof fetch, input: string): Promise<Response> {
37 const controller = new AbortController();
38 const timeout = setTimeout(() => {
39 controller.abort();
40 }, CDN_FETCH_TIMEOUT_MS);
41 try {
42 return await fetchImpl(input, { signal: controller.signal });
43 } finally {
44 clearTimeout(timeout);
45 }
46}
47
48/**
49 * Fetch the latest published Kimi Code version from the CDN.

Callers 2

Calls 1

abortMethod · 0.65

Tested by

no test coverage detected