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

Function waitUntil

packages/nextjs/src/common/utils/responseEnd.ts:61–70  ·  view source on GitHub ↗
(task: Promise<unknown>)

Source from the content-addressed store, hash-verified

59 * Uses platform-specific waitUntil function to wait for the provided task to complete without blocking.
60 */
61export function waitUntil(task: Promise<unknown>): void {
62 // If deployed on Cloudflare, use the Cloudflare waitUntil function to flush the events
63 if (isCloudflareWaitUntilAvailable()) {
64 cloudflareWaitUntil(task);
65 return;
66 }
67
68 // otherwise, use vercel's
69 vercelWaitUntil(task);
70}
71
72type MinimalCloudflareContext = {
73 // eslint-disable-next-line @typescript-eslint/no-explicit-any

Callers 15

captureRequestErrorFunction · 0.90
wrapMiddlewareWithSentryFunction · 0.90
applyFunction · 0.90
wrapApiHandlerWithSentryFunction · 0.90
initFunction · 0.90
wrapRequestHandlerFunction · 0.85

Calls 3

vercelWaitUntilFunction · 0.90
cloudflareWaitUntilFunction · 0.85

Tested by

no test coverage detected