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> {
103
103
const isServerless =
104
104
! ! process . env . FUNCTIONS_WORKER_RUNTIME || // Azure Functions
105
105
! ! process . env . LAMBDA_TASK_ROOT || // AWS Lambda
106
+ ! ! process . env . K_SERVICE || // Google Cloud Run
106
107
! ! process . env . CF_PAGES || // Cloudflare
107
108
! ! process . env . VERCEL ||
108
109
! ! process . env . NETLIFY ;
Original file line number Diff line number Diff line change @@ -5,7 +5,13 @@ import { DEBUG_BUILD } from '../common/debug-build';
5
5
6
6
/** Flush the event queue to ensure that events get sent to Sentry before the response is finished and the lambda ends */
7
7
export 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 ;
9
15
10
16
if ( isServerless ) {
11
17
try {
Original file line number Diff line number Diff line change @@ -22,9 +22,15 @@ export async function flushIfServerless(): Promise<void> {
22
22
return ;
23
23
}
24
24
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 ;
26
32
27
- if ( ! platformSupportsStreaming ) {
33
+ if ( isServerless ) {
28
34
try {
29
35
DEBUG_BUILD && debug . log ( 'Flushing events...' ) ;
30
36
await flush ( 2000 ) ;
You can’t perform that action at this time.
0 commit comments