fog very slow deleting files. trying aws gem instead

This commit is contained in:
Espen Antonsen 2011-04-12 12:54:38 +08:00
parent 5da472e772
commit 7acec90448
4 changed files with 22 additions and 25 deletions

View file

@ -12,7 +12,8 @@ gem "carrierwave", :git => 'git://github.com/jnicklas/carrierwave.git'
gem 'sqlite3-ruby' gem 'sqlite3-ruby'
# S3 support # S3 support
gem 'fog' #gem 'fog'
gem 'aws'
# ImageMagick: # ImageMagick:
#gem "rmagick", :require => 'RMagick' #gem "rmagick", :require => 'RMagick'

View file

@ -36,22 +36,16 @@ GEM
activesupport (= 3.0.6) activesupport (= 3.0.6)
activesupport (3.0.6) activesupport (3.0.6)
arel (2.0.9) arel (2.0.9)
aws (2.4.5)
activesupport
http_connection
uuidtools
xml-simple
builder (2.1.2) builder (2.1.2)
erubis (2.6.6) erubis (2.6.6)
abstract (>= 1.0.0) abstract (>= 1.0.0)
excon (0.6.1) http_connection (1.4.0)
fog (0.7.2)
builder
excon (>= 0.6.1)
formatador (>= 0.1.3)
json
mime-types
net-ssh (>= 2.1.3)
nokogiri (>= 1.4.4)
ruby-hmac
formatador (0.1.3)
i18n (0.5.0) i18n (0.5.0)
json (1.5.1)
mail (2.2.15) mail (2.2.15)
activesupport (>= 2.3.6) activesupport (>= 2.3.6)
i18n (>= 0.4.0) i18n (>= 0.4.0)
@ -61,8 +55,6 @@ GEM
mini_exiftool (1.3.0) mini_exiftool (1.3.0)
mini_magick (3.2) mini_magick (3.2)
subexec (~> 0.0.4) subexec (~> 0.0.4)
net-ssh (2.1.4)
nokogiri (1.4.4)
polyglot (0.3.1) polyglot (0.3.1)
rack (1.2.2) rack (1.2.2)
rack-mount (0.6.14) rack-mount (0.6.14)
@ -83,7 +75,6 @@ GEM
rake (>= 0.8.7) rake (>= 0.8.7)
thor (~> 0.14.4) thor (~> 0.14.4)
rake (0.8.7) rake (0.8.7)
ruby-hmac (0.4.0)
sqlite3 (1.3.3) sqlite3 (1.3.3)
sqlite3-ruby (1.3.3) sqlite3-ruby (1.3.3)
sqlite3 (>= 1.3.3) sqlite3 (>= 1.3.3)
@ -92,13 +83,15 @@ GEM
treetop (1.4.9) treetop (1.4.9)
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
tzinfo (0.3.26) tzinfo (0.3.26)
uuidtools (2.1.2)
xml-simple (1.0.15)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
aws
carrierwave! carrierwave!
fog
mime-types mime-types
mini_exiftool mini_exiftool
mini_magick mini_magick

View file

@ -8,7 +8,7 @@ class FileUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader # Choose what kind of storage to use for this uploader
if ENV['S3_KEY'] if ENV['S3_KEY']
storage :fog storage :s3
def cache_dir def cache_dir
"#{RAILS_ROOT}/tmp/uploads" if ENV['HEROKU'] == 'true' "#{RAILS_ROOT}/tmp/uploads" if ENV['HEROKU'] == 'true'

View file

@ -1,9 +1,12 @@
CarrierWave.configure do |config| CarrierWave.configure do |config|
config.fog_credentials = { config.s3_access_key_id = ENV['S3_KEY']
:provider => 'AWS', config.s3_secret_access_key = ENV['S3_SECRET']
:aws_access_key_id => ENV['S3_KEY'], config.s3_bucket = ENV['S3_BUCKET']
:aws_secret_access_key => ENV['S3_SECRET'], #config.fog_credentials = {
:region => 'us-east-1' # :provider => 'AWS',
} # :aws_access_key_id => ENV['S3_KEY'],
config.fog_directory = ENV['S3_BUCKET'] # :aws_secret_access_key => ENV['S3_SECRET'],
# :region => 'us-east-1'
#}
#config.fog_directory = ENV['S3_BUCKET']
end end