• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pulibrary / oawaiver / d4949001-0115-46f7-b7b8-03ff41f966f1

03 Oct 2024 07:06PM UTC coverage: 98.928% (-1.1%) from 100.0%
d4949001-0115-46f7-b7b8-03ff41f966f1

Pull #205

circleci

jrgriffiniii
wip
Pull Request #205: Integrates a health endpoint which ensures that Solr availability can be determined by HTTP request

2 of 10 new or added lines in 1 file covered. (20.0%)

738 of 746 relevant lines covered (98.93%)

17.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/app/checks/solr_status.rb
1
# frozen_string_literal: true
2

3
class SolrStatus < HealthMonitor::Providers::Base
1✔
4
  def check!
1✔
NEW
5
    url = Sunspot.config.solr.url
×
NEW
6
    uri = URI(url)
×
NEW
7
    status_uri = URI("#{uri.scheme}://#{uri.hostname}:#{uri.port}/solr/admin/cores?action=STATUS")
×
8

NEW
9
    req = Net::HTTP::Get.new(status_uri)
×
NEW
10
    req.basic_auth(uri.user, uri.password) if uri.user && uri.password
×
NEW
11
    response = Net::HTTP.start(uri.hostname, uri.port) { |http| http.request(req) }
×
12

NEW
13
    json = JSON.parse(response.body)
×
NEW
14
    raise "The solr has an invalid status #{status_uri}" if json["responseHeader"]["status"] != 0
×
15
  end
16
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc