Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hi,
I noticed that some of my users who use products depending on serverless functions are getting an error response after about 40 seconds, even though I set the timeout to the maximum value of 900 seconds.
However, I decided to create a dummy function that waits for 50 seconds and then returns a Hello World response. The result is that after about 40 seconds, it returns a 202 status code with the response body Response not yet ready.
How can I make the function wait until the real promise finishes and then return the result, or at least wait until the timeout that I set in the function settings?
The dummy function code:
async function main(args) {
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
await wait(50000);
return {"body": "Hello World!"};
}
The timeout settings

The result of the execution of the function after about 40 seconds

Rory McEwan
Anjanesh Lekshminarayanan
182d09356ab94d3893ddfaca4f0270
Prashant Kumbhat
kprichard
e452769e8f30404d81a3bc803143f4
robert
Eleanor
GamesmenJordan