File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
sveltekit/src/server-common Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,7 @@ export async function flushIfServerless(): Promise<void> {
103103 const isServerless =
104104 ! ! process . env . FUNCTIONS_WORKER_RUNTIME || // Azure Functions
105105 ! ! process . env . LAMBDA_TASK_ROOT || // AWS Lambda
106+ ! ! process . env . K_SERVICE || // Google Cloud Run
106107 ! ! process . env . CF_PAGES || // Cloudflare
107108 ! ! process . env . VERCEL ||
108109 ! ! process . env . NETLIFY ;
Original file line number Diff line number Diff line change @@ -5,7 +5,13 @@ import { DEBUG_BUILD } from '../common/debug-build';
55
66/** Flush the event queue to ensure that events get sent to Sentry before the response is finished and the lambda ends */
77export async function flushIfServerless ( ) : Promise < void > {
8- const isServerless = ! ! process . env . LAMBDA_TASK_ROOT || ! ! process . env . VERCEL ;
8+ const isServerless =
9+ ! ! process . env . FUNCTIONS_WORKER_RUNTIME || // Azure Functions
10+ ! ! process . env . LAMBDA_TASK_ROOT || // AWS Lambda
11+ ! ! process . env . K_SERVICE || // Google Cloud Run
12+ ! ! process . env . CF_PAGES || // Cloudflare
13+ ! ! process . env . VERCEL ||
14+ ! ! process . env . NETLIFY ;
915
1016 if ( isServerless ) {
1117 try {
Original file line number Diff line number Diff line change @@ -22,9 +22,15 @@ export async function flushIfServerless(): Promise<void> {
2222 return ;
2323 }
2424
25- const platformSupportsStreaming = ! process . env . LAMBDA_TASK_ROOT && ! process . env . VERCEL ;
25+ const isServerless =
26+ ! ! process . env . FUNCTIONS_WORKER_RUNTIME || // Azure Functions
27+ ! ! process . env . LAMBDA_TASK_ROOT || // AWS Lambda
28+ ! ! process . env . K_SERVICE || // Google Cloud Run
29+ ! ! process . env . CF_PAGES || // Cloudflare
30+ ! ! process . env . VERCEL ||
31+ ! ! process . env . NETLIFY ;
2632
27- if ( ! platformSupportsStreaming ) {
33+ if ( isServerless ) {
2834 try {
2935 DEBUG_BUILD && debug . log ( 'Flushing events...' ) ;
3036 await flush ( 2000 ) ;
You can’t perform that action at this time.
0 commit comments