File tree 1 file changed +4
-1
lines changed
npm-packages/node-executor/src
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ const warmupPromise = populatePrebuildPackages();
8
8
9
9
declare const awslambda : any ;
10
10
11
+ const CALLBACK_WAIT_FOR_EMPTY_EVENT_LOOP =
12
+ process . env . CALLBACK_WAITS_FOR_EMPTY_EVENT_LOOP === "true" ;
13
+
11
14
// eslint-disable-next-line @typescript-eslint/no-unused-vars
12
15
export const handler = awslambda . streamifyResponse (
13
16
async ( event : any , responseStream : Writable , context : Context ) => {
@@ -27,7 +30,7 @@ export const handler = awslambda.streamifyResponse(
27
30
//
28
31
// The downside is loss of isolation between invocations:
29
32
// timers may fire the next time the runtime is used.
30
- context . callbackWaitsForEmptyEventLoop = false ;
33
+ context . callbackWaitsForEmptyEventLoop = CALLBACK_WAIT_FOR_EMPTY_EVENT_LOOP ;
31
34
32
35
setDebugLogging ( true ) ;
33
36
await warmupPromise ;
You can’t perform that action at this time.
0 commit comments