Skip to content
Browse files

Rescue S3 errors when backfilling the log_url fields.

  • Loading branch information...
1 parent 50b9f54 commit 728b1420c0461c0c80d2f958c5a62f46faec2ed1 @seancribbs seancribbs committed
Showing with 7 additions and 2 deletions.
  1. +7 −2 Rakefile
View
9 Rakefile
@@ -30,8 +30,13 @@ namespace :db do
task :backfill_log_url => :environment do
TestResult.where('log_url IS NULL').each do |result|
puts "Backfilling test result: #{result.id}."
- result.log_url = GiddyUp::S3.directories.get(GiddyUp::LogBucket).files.new(:key => "#{result.id}.log").public_url
- result.save
+ begin
+ result.log_url = GiddyUp::S3.directories.get(GiddyUp::LogBucket).files.new(:key => "#{result.id}.log").public_url
+ rescue Excon::Errors::Error => e
+ puts " Failed! #{e.message.split(/\n/).first}"
+ else
+ result.save
+ end
end
end

0 comments on commit 728b142

Please sign in to comment.
Something went wrong with that request. Please try again.