Skip to content

Commit

Permalink
in Californica::Deleter, recover from RSolr http errors (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefilter authored Mar 14, 2024
1 parent 18c379f commit 67feb00
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/lib/californica/deleter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ def destroy_and_eradicate
Hyrax.config.callback.run(:after_destroy, record.id, User.batch_user)
log("Deleted #{record.class} #{record.id} in #{ActiveSupport::Duration.build(Time.current - start_time)}")
log("deleted item ark is: #{record.ark}")
rescue Ldp::HttpError, Faraday::TimeoutError, Faraday::ConnectionFailed => e
rescue Ldp::HttpError, Faraday::TimeoutError, Faraday::ConnectionFailed, RSolr::Error::Http => e
log("#{e.class}: #{e.message}")
retries ||= 0
if (retries += 1) > 3
return false # Explicitly return false after retries are exhausted
else
sleep(10**(retries - 1))
retry
end
end
Expand Down

0 comments on commit 67feb00

Please sign in to comment.