(task: Promise<unknown>)
| 59 | * Uses platform-specific waitUntil function to wait for the provided task to complete without blocking. |
| 60 | */ |
| 61 | export 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 | |
| 72 | type MinimalCloudflareContext = { |
| 73 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
no test coverage detected