Hello! I'm having some issues with my API timing o...
# help
c
Hello! I'm having some issues with my API timing out after 6 seconds, I've set a higher timeout but my API keeps dying. Anyone knows whats causing this? My code looks like this (I'm just waiting 10 seconds)
Copy code
export const main: APIGatewayProxyHandlerV2<any> = async (e,context) => {

   await wait(10000);
   console.log(context.getRemainingTimeInMillis());

  return okHandler({finished:true})
}
And the Stack Function looks like this:
Copy code
const assetFunction = new sst.Function(this, "assetApiFunction", {
      environment: { ...props.enviroment_vars, functionBatch: functionBatch.functionName },
      handler: 'src/services/query/routes/assets.main',
      timeout:29,
      permissions: ['lambda',"dynamodb"]
    })
s
Do you know if the timeout is happening inside the lambda, or outside (e.g. you cannot connect to API Gateway)? I've seen timeouts from network issues (e.g. my lambda is in a VPC but I am not on a VPN, or I'm trying to talk to RDS, but the security group is misconfigured, etc)
c
Thank you for you response 😄. I think the problem come from inside the API Gateway, as the function continues to execute but the browser fails to load the endpoit.
j
@Casiel Didriksson Muriedas how are you defining the API btw?