Reputation: 3791
My Rails Application Uses AWS SDK v3 to invoke lambda functions as follows
lambda_client = Aws::Lambda::Client.new(client_config)
lambda_return_value = lambda_client.invoke(
{
function_name: function_name,
invocation_type: 'RequestResponse',
log_type: 'None',
payload: generated_payload,
}
Most of my lambda functions execute successfully, but the ones that take longer than ~60sec result in the following exception on the ruby side even though the lambda executes completely
A Seahorse::Client::NetworkingError occurred in background at 2019-07-11 00:47:18 -0500 :
Net::ReadTimeout
I have gone through the documentation and cannot find a way to set a longer timeout for my lambda invocation. Any ideas how to get ruby to wait for the invocation and not timeout?
Upvotes: 1
Views: 1226
Reputation: 378
Hi Aws::Lambda::Client default timeout is 60 but you can change this while creating new client. Set :http_read_timeout
in your client_config
client_config = {
....
http_read_timeout: 100
}
then create new client
lambda_client = Aws::Lambda::Client.new(client_config)
For more reference: https://docs.aws.amazon.com/sdkforruby/api/Aws/Lambda/Client.html
I hope that helpful
Upvotes: 5