AWS lambda nodejs runtime: io: read/write on closed pipe

你。 提交于 2019-12-01 08:20:51

Lambda's default timeout is 3 seconds and I was hitting that beyond a single HTTP call. Just need to update SAM Template to increase the timeout for handlers that needs to call multiple third party services.

Updated template with timeout set to 10 seconds allows the handler to run to completion.

AWSTemplateFormatVersion : '2010-09-09'
Transform: AWS::Serverless-2016-10-31

Description: |
  Data service

Resources:
  OAuthCallback:
    Type: AWS::Serverless::Function
    Properties:
      Runtime: nodejs6.10
      CodeUri: ./build/services/quickbooks
      Handler: oauth2.callbackHandler
      Timeout: 10
      Events:
        AuthRoute:
          Type: Api
          Properties:
            Path: /oauth2/callback
            Method: get
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!