Class: Healthchecker::Checks::Solr
Instance Attribute Summary
#options
Instance Method Summary
collapse
#initialize, #perform_check
Instance Method Details
#check! ⇒ Object
16
17
18
19
20
21
22
|
# File 'lib/healthchecker/checks/solr.rb', line 16
def check!
msg = "Could not connect to solr"
ping_success = client.head("admin/ping", :headers => {"Cache-Control" => "If-None-Match"}).response[:status] == 200
raise msg unless ping_success
rescue => e
raise msg
end
|
#client ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'lib/healthchecker/checks/solr.rb', line 6
def client
if options[:rsolr_client]
options[:rsolr_client]
elsif options[:url]
RSolr.connect(url: options[:url])
else
Sunspot::Session.new.send(:connection)
end
end
|