From 1249e7ceff214656211088fef11691177971823c Mon Sep 17 00:00:00 2001 From: Ryan McGeary Date: Thu, 13 Mar 2008 18:41:19 -0400 Subject: [PATCH 1/2] Added a 'persistent' amazon s3 connection config parameter to turn off persistent connections if necessary. The default is the same as the default for the aws-s3 gem, which is to keep persistent connections. --- lib/technoweenie/attachment_fu/backends/s3_backend.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/technoweenie/attachment_fu/backends/s3_backend.rb b/lib/technoweenie/attachment_fu/backends/s3_backend.rb index 0664b8e1..3a260821 100644 --- a/lib/technoweenie/attachment_fu/backends/s3_backend.rb +++ b/lib/technoweenie/attachment_fu/backends/s3_backend.rb @@ -145,7 +145,8 @@ def self.included(base) #:nodoc: :secret_access_key => s3_config[:secret_access_key], :server => s3_config[:server], :port => s3_config[:port], - :use_ssl => s3_config[:use_ssl] + :use_ssl => s3_config[:use_ssl], + :persistent => s3_config.has_key?(:persistent) ? s3_config[:persistent] : true ) # Bucket.create(@@bucket_name) @@ -306,4 +307,4 @@ def save_to_storage end end end -end \ No newline at end of file +end From c3403c708389ef173cdc6fc67f4d73a6ecd24296 Mon Sep 17 00:00:00 2001 From: Ryan McGeary Date: Thu, 13 Mar 2008 20:13:58 -0400 Subject: [PATCH 2/2] Cleanup the Amazon S3 establish_connection call to accept all aws-s3 options. --- lib/technoweenie/attachment_fu/backends/s3_backend.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/technoweenie/attachment_fu/backends/s3_backend.rb b/lib/technoweenie/attachment_fu/backends/s3_backend.rb index 3a260821..716b2612 100644 --- a/lib/technoweenie/attachment_fu/backends/s3_backend.rb +++ b/lib/technoweenie/attachment_fu/backends/s3_backend.rb @@ -140,14 +140,7 @@ def self.included(base) #:nodoc: @@bucket_name = s3_config[:bucket_name] - Base.establish_connection!( - :access_key_id => s3_config[:access_key_id], - :secret_access_key => s3_config[:secret_access_key], - :server => s3_config[:server], - :port => s3_config[:port], - :use_ssl => s3_config[:use_ssl], - :persistent => s3_config.has_key?(:persistent) ? s3_config[:persistent] : true - ) + Base.establish_connection!(s3_config.slice(:access_key_id, :secret_access_key, :server, :port, :use_ssl, :persistent, :proxy)) # Bucket.create(@@bucket_name)