Skip to content

Commit

Permalink
Use File.open instead of File.read for better memory usage, per binar…
Browse files Browse the repository at this point in the history
…ylogic's recommendation.
  • Loading branch information
perezd committed Apr 26, 2010
1 parent f6e6521 commit fc8f9c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backup.rake
Expand Up @@ -51,7 +51,7 @@ namespace :backups do
bucket = AWS::S3::Bucket.find(BACKUP_BUCKET)
end

AWS::S3::S3Object.store(backup_name, File.read(backup_path), bucket.name, :content_type => 'application/x-gzip')
AWS::S3::S3Object.store(backup_name, File.open(backup_path,"r"), bucket.name, :content_type => 'application/x-gzip')
`rm -rf #{backup_path}`
puts "backup completed @ #{Time.now}"
end
Expand Down

0 comments on commit fc8f9c8

Please sign in to comment.