Skip to content

Commit

Permalink
Merge pull request #266 from sul-dlss/clean-handler
Browse files Browse the repository at this point in the history
Remove a handler that wasn't ever used
  • Loading branch information
justinlittman committed May 14, 2019
2 parents f012041 + b83ffcb commit 7c3bd23
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions app/models/dor/goobi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@ module Dor
# This class passes data to the Goobi server using a custom XML message that was developed by Intranda
class Goobi < ServiceItem
def register
handler = proc do |exception, attempt_number, _total_delay|
if attempt_number >= Dor::Config.goobi.max_tries
throw :error, message: "#{exception.class} on goobi notification web service call #{attempt_number} for #{@druid_obj.id}", status: 500
end
end

# rubocop:disable Metrics/LineLength
with_retries(max_tries: Dor::Config.goobi.max_tries, handler: handler, base_sleep_seconds: Dor::Config.goobi.base_sleep_seconds, max_sleep_seconds: Dor::Config.goobi.max_sleep_seconds) do |_attempt|
response = RestClient.post(Dor::Config.goobi.url, xml_request, content_type: 'application/xml') { |resp, _request, _result| resp }
with_retries(max_tries: Dor::Config.goobi.max_tries,
base_sleep_seconds: Dor::Config.goobi.base_sleep_seconds,
max_sleep_seconds: Dor::Config.goobi.max_sleep_seconds) do |_attempt|
response = RestClient.post(Dor::Config.goobi.url, xml_request, content_type: 'application/xml')
response
end
# rubocop:enable Metrics/LineLength
end

def goobi_xml_tags
Expand Down

0 comments on commit 7c3bd23

Please sign in to comment.