Skip to content

Disconnect for Lambda? #2221

Answered by 2color
jonthewayne asked this question in Q&A
Apr 18, 2020 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

The fix for this, as detailed in #2241 (comment) is to set the the context.callbackWaitsForEmptyEventLoop of the AWS Lambda Context Object to false as follows:

exports.server = (event, context, cb) => {
  // Set to false to send the response right away when the callback executes, instead of waiting for the Node.js event loop to be empty.
  context.callbackWaitsForEmptyEventLoop = false

  return lambda.graphqlHandler(event, context, cb)
}

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@jonthewayne
Comment options

Comment options

You must be logged in to vote
1 reply
@2color
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by 2color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants