ruby on rails - Anyone else experiencing aws-s3 timeout problems when looking for nonexistant keys? S3Object.exist? and S3Object.request(:head, ..) -
has been having problems aws-s3's s3object.exists?, or s3object.request(:head, ...) timing out when passed keys not exist? (i'm running aws-s3 0.6.2, ruby 1.9.2). using s3object.find('thenonexistantkey', bucket) raises nosuchkey exception expected. issue on amazon's side?
aws-s3 gem not set timeout reasonable values
you can monkeypatching create_connection
method
create file config/initializers/aws_s3_connection_monkey_patch.rb
:
# sets timeouts appropriate values s3 module aws module s3 class connection #:nodoc: private def create_connection_with_timeout_settings http = create_connection_without_timeout_settings http.open_timeout = 1 http.read_timeout = 5 http end alias_method_chain :create_connection, :timeout_settings end end end
Comments
Post a Comment