Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'right_aws'
- access_key = 'AKIAJOJ3GQZAPSXF72SQ'
- secret_key = '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'
- bucket = 'headius-test'
- file = 'blah.txt'
- interface = RightAws::S3Interface.new access_key, secret_key, {:multi_thread => true}
- (1..10).map {|t|
- Thread.new {
- i = 0
- loop do
- begin
- puts "Thread #{t} item #{i}"
- i+=1
- interface.head bucket, file
- rescue RightAws::AwsError # thrown on 404
- p 'error'
- p $!
- end
- end
- }
- }
- sleep
Add Comment
Please, Sign In to add comment