Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added some TODOs

  • Loading branch information...
commit b45f58cf4dbabfbf86e1b0a36ae829147ab74c66 1 parent 4ff63ec
@ubermajestix authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/airbrake_stats/parser.rb
View
8 lib/airbrake_stats/parser.rb
@@ -33,12 +33,13 @@ def similar_errors
end
id = parse_xml(notice, 'id')
url = parse_xml(notice, 'url')
- format = parse_xml(notice, 'format')
+ format = parse_xml(notice, 'action-dispatch-request-formats')
path = parse_xml(notice, 'request-path')
controller = parse_xml(notice, 'controller')
error_message = parse_xml(notice, 'error-message')
action = parse_xml(notice, 'action')
controller = "#{controller}##{action}"
+ #TODO build up the params hash (excluding action and controller) from the params node.
#next unless url && agent && path && format
Map.new(id: id, path: path, format: format, error_message: error_message, url: url, agent: agent, controller: controller )
end.compact
@@ -121,7 +122,6 @@ def notices_xml
notices_xml = AirbrakeStats::Queue.new
puts "Downloading errors..."
threads = []
- # TODO sometimes this craps out. Ususally when we ask for pages > 20
similar_error_ids.each_slice(4) do |slice|
threads << Thread.new(slice) do |ids|
ids.each_with_index do |id, index|
@@ -142,7 +142,9 @@ def url
def parse(path, page = nil)
params = "?auth_token=#{ENV['AIRBRAKE_TOKEN']}"
params << "&page=#{page}" if page
- # puts "#{url}#{path}.xml#{params}"
+ # TODO sometimes this craps out. Ususally when we ask for pages > 20
+ # Error: `sysread_nonblock': Resource temporarily unavailable (Errno::EAGAIN)
+ # should put retry logic in here, i.e. keep trying to get a connection until you can
response = Http.get("#{url}#{path}.xml#{params}", response: :object)
parsed_response = Nokogiri::XML(response.body)
if response.status == 200
Please sign in to comment.
Something went wrong with that request. Please try again.