Class: Hyrax::HealthChecks::SolrCheck

Inherits:
OkComputer::Check
  • Object
show all
Defined in:
lib/hyrax/health_checks/solr_check.rb

Instance Method Summary collapse

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

#checkObject


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

  mark_message 'Solr connection failed'
  mark_failure
rescue RSolr::Error::ConnectionRefused => err
  mark_message "Solr connection refused: #{err.message}"
  mark_failure
rescue RuntimeError => err
  mark_message "Solr connection failed: #{err.message}"
  mark_failure
end