class Healthchecker::Checks::Solr

Public Instance Methods

check!() click to toggle source
# 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() click to toggle source
# 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