MCPcopy Index your code
hub / github.com/simstudioai/sim / sleepUntilAborted

Function sleepUntilAborted

apps/sim/lib/data-drains/destinations/utils.ts:9–22  ·  view source on GitHub ↗
(ms: number, signal: AbortSignal)

Source from the content-addressed store, hash-verified

7 * a `setTimeout` that ignores the abort signal.
8 */
9export function sleepUntilAborted(ms: number, signal: AbortSignal): Promise<void> {
10 if (signal.aborted) return Promise.resolve()
11 return new Promise((resolve) => {
12 const onAbort = () => {
13 clearTimeout(timeoutId)
14 resolve()
15 }
16 const timeoutId = setTimeout(() => {
17 signal.removeEventListener('abort', onAbort)
18 resolve()
19 }, ms)
20 signal.addEventListener('abort', onAbort, { once: true })
21 })
22}
23
24export function normalizePrefix(raw: string | undefined): string {
25 if (!raw) return ''

Callers 6

insertAllFunction · 0.90
fetchWithRetryFunction · 0.90
deliverFunction · 0.90
executeStatementFunction · 0.90
pollStatementFunction · 0.90
postWithRetriesFunction · 0.90

Calls 2

resolveMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected