MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / vercelWaitUntil

Function vercelWaitUntil

packages/core/src/utils/vercelWaitUntil.ts:18–33  ·  view source on GitHub ↗
(task: Promise<unknown>)

Source from the content-addressed store, hash-verified

16 * Vendored from https://www.npmjs.com/package/@vercel/functions
17 */
18export function vercelWaitUntil(task: Promise<unknown>): void {
19 // We only flush manually in Vercel Edge runtime
20 // In Node runtime, we use process.on('SIGTERM') instead
21 if (typeof EdgeRuntime !== 'string') {
22 return;
23 }
24 const vercelRequestContextGlobal: VercelRequestContextGlobal | undefined =
25 // @ts-expect-error This is not typed
26 GLOBAL_OBJ[Symbol.for('@vercel/request-context')];
27
28 const ctx = vercelRequestContextGlobal?.get?.();
29
30 if (ctx?.waitUntil) {
31 ctx.waitUntil(task);
32 }
33}

Callers 4

flushIfServerlessFunction · 0.90
waitUntilFunction · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected