Skip to content

Commit b7979b1

Browse files
gautamg795Convex, Inc.
authored and
Convex, Inc.
committed
node executor changes
GitOrigin-RevId: 1d9f177f265ca1394d0447c5c97ded9a1a70eac5
1 parent cb9c617 commit b7979b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

npm-packages/node-executor/src/aws_lambda.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const warmupPromise = populatePrebuildPackages();
88

99
declare const awslambda: any;
1010

11+
const CALLBACK_WAIT_FOR_EMPTY_EVENT_LOOP =
12+
process.env.CALLBACK_WAITS_FOR_EMPTY_EVENT_LOOP === "true";
13+
1114
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1215
export const handler = awslambda.streamifyResponse(
1316
async (event: any, responseStream: Writable, context: Context) => {
@@ -27,7 +30,7 @@ export const handler = awslambda.streamifyResponse(
2730
//
2831
// The downside is loss of isolation between invocations:
2932
// timers may fire the next time the runtime is used.
30-
context.callbackWaitsForEmptyEventLoop = false;
33+
context.callbackWaitsForEmptyEventLoop = CALLBACK_WAIT_FOR_EMPTY_EVENT_LOOP;
3134

3235
setDebugLogging(true);
3336
await warmupPromise;

0 commit comments

Comments
 (0)