Class: Hyrax::HealthChecks::SolrCheck
- Inherits:
-
OkComputer::Check
- Object
- OkComputer::Check
- Hyrax::HealthChecks::SolrCheck
- Defined in:
- lib/hyrax/health_checks/solr_check.rb
Instance Method Summary collapse
- #check ⇒ Object
-
#initialize(service: Hyrax::SolrService) ⇒ SolrCheck
constructor
A new instance of SolrCheck.
Constructor Details
#initialize(service: Hyrax::SolrService) ⇒ SolrCheck
Returns a new instance of SolrCheck.
6 7 8 |
# File 'lib/hyrax/health_checks/solr_check.rb', line 6 def initialize(service: Hyrax::SolrService) @service = service end |
Instance Method Details
#check ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/hyrax/health_checks/solr_check.rb', line 10 def check return if @service.ping 'Solr connection failed' mark_failure rescue RSolr::Error::ConnectionRefused => err "Solr connection refused: #{err.}" mark_failure rescue RuntimeError => err "Solr connection failed: #{err.}" mark_failure end |