Last active
November 3, 2015 14:38
-
-
Save jcreed/88ca20e861baa9df8214 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :airbrake_logs do | |
desc "Load all errors from Airbrake logs" | |
task :re_etl => [:environment] do |task| | |
display :notice, task.full_comment | |
errors = ["PG::Error: ERROR: deadlock detected", 'PG::Error: ERROR: null value in column "program_id"'] | |
errors.each do |group_error| | |
group = Cas3Logs::Api::Groups.new(group_error) | |
if group_key = group.group_key | |
pages = group.notice_pages | |
puts "There are #{pages} pages for group: #{group_key}" | |
else | |
puts "No group found for #{group_error}" | |
end | |
end | |
display :success, "#{task}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment