132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
|
# File 'lib/app/models/notification.rb', line 132
def deliver_message
start_processing
deliver_message!
finish_processing
rescue StandardError => error
if retries > 10
log_error "Unable to process notification id: #{id}, done retrying", error
finish_processing "Failed final attempt: #{error.message}"
notify_failure(error)
else
log_error "Unable to process notification id: #{id}, retrying!!", error
retry_delivery("Failed attempt # #{retries}: #{error.message}")
delay(run_at: 10.minutes.from_now).deliver
end
end
|