MCPcopy Create free account
hub / github.com/arctic-cli/interface / sleep

Function sleep

packages/arctic/src/session/retry.ts:9–21  ·  view source on GitHub ↗
(ms: number, signal: AbortSignal)

Source from the content-addressed store, hash-verified

7 export const RETRY_MAX_DELAY_NO_HEADERS = 30_000 // 30 seconds
8
9 export async function sleep(ms: number, signal: AbortSignal): Promise<void> {
10 return new Promise((resolve, reject) => {
11 const timeout = setTimeout(resolve, ms)
12 signal.addEventListener(
13 "abort",
14 () => {
15 clearTimeout(timeout)
16 reject(new DOMException("Aborted", "AbortError"))
17 },
18 { once: true },
19 )
20 })
21 }
22
23 // extract retry delay from google error messages like "quota will reset after 46s"
24 function extractGoogleRetryDelay(message: string): number | undefined {

Callers 2

createSseClientFunction · 0.85
createSseClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected