AWS Lambda RDS connection timeout

前端 未结 8 1623
栀梦
栀梦 2020-12-14 02:10

I\'m trying to write a Lambda function using Node.js which connects to my RDS database. The database is working and accessible from my Elastic Beanstalk environment. When I

8条回答
  •  天涯浪人
    2020-12-14 02:34

    The problem does not originate from the timeout, but from the way you close the connection. Use .destroy() instead if you do not want to wait for the callback that OR use the callback correctly when closing the connection in .end(function(err) { //Now call your callback });

    See this thread for a more in depth explanation.

提交回复
热议问题