AWS Lambda function timing out

后端 未结 2 1523
夕颜
夕颜 2021-01-21 04:13

In my local mocha tests the following handler function works just fine. However, when I upload to AWS (using Serverless framework) it times out (unless you don\'t provide a

2条回答
  •  无人共我
    2021-01-21 04:51

    I guess that you're using lambda with "Node.js Runtime 0.10"

    So you should add

    context.done(null, 'Terminate Lambda');
    

    to terminate the execution.

    As the AWS lambda document, it mentions that:

    The callback is supported only in the Node.js runtime v4.3. If you are using the earlier runtime v0.10.42, you need to use the context methods (done, succeed, and fail) to properly terminate the Lambda function.

    Please refer this link for above information

提交回复
热议问题