Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecesary retrying on creating events #16954

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/api/app/models/update_notification_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,8 @@ def create_events
e.elements('data') do |d|
data[d['key']] = d['_content']
end
retries = 10
begin
event = Event::Factory.new_from_type(type, data)
event.save!
rescue ActiveRecord::StatementInvalid => e
retries -= 1
if retries.positive?
Airbrake.notify("Failed to create Event : #{type.inspect}: #{data} #{e}")
retry
end
Airbrake.notify("Failed to create Event : #{type.inspect}: #{data} #{e}")
rescue StandardError => e
Airbrake.notify("Failed to create Event : #{type.inspect}: #{data} #{e}")
end
event = Event::Factory.new_from_type(type, data)
event.save!
end
end

Expand Down