I have a simple lambda function that asynchronously makes an API calls and then returns data. 99% of the time this works great. When ever the API takes longer then the lambda configured timeout, it gives an error as expected. Now the issue is that when I make any subsequent calls to the lambda function it permanently gives me the timeout error.
"errorMessage": "2016-05-14T22:52:07.247Z {session} Task timed out after 3.00 seconds"
In order to test that this was the case I set the lambda timeout to 3 seconds and have a way to trigger these two functions within the lambda.
Javascript
function now() {
return response.tell('success');
}
function wait() {
setTimeout(function() { return response.tell('success'); }, 4000);
}
When I call the now
function there are no problems. When I call the wait
function I get the timeout error and then any subsequent calls to now
give me the same error.
Is this an expected behavior? I would think that any subsequent calls to the lambda function should work. I understand I can always increase the configuration timeout, but would rather not.