File tree Expand file tree Collapse file tree 7 files changed +42
-2
lines changed
Expand file tree Collapse file tree 7 files changed +42
-2
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ gem 'geoblacklight', '~> 4.4.2'
1313gem 'importmap-rails'
1414gem 'jbuilder'
1515gem 'jquery-rails'
16+ gem 'okcomputer' , '~> 1.19'
1617gem 'omniauth'
1718gem 'omniauth-cas' , '3.0.0'
1819gem 'omniauth-rails_csrf_protection' , '~> 1.0'
Original file line number Diff line number Diff line change 166166 faraday-retry (2.2.1 )
167167 faraday (~> 2.0 )
168168 ffi (1.17.0-aarch64-linux-gnu )
169+ ffi (1.17.0-arm64-darwin )
169170 ffi (1.17.0-x86_64-darwin )
170171 ffi (1.17.0-x86_64-linux-gnu )
171172 ffi (1.17.0-x86_64-linux-musl )
@@ -281,13 +282,16 @@ GEM
281282 nio4r (2.7.4 )
282283 nokogiri (1.16.7-aarch64-linux )
283284 racc (~> 1.4 )
285+ nokogiri (1.16.7-arm64-darwin )
286+ racc (~> 1.4 )
284287 nokogiri (1.16.7-x86_64-darwin )
285288 racc (~> 1.4 )
286289 nokogiri (1.16.7-x86_64-linux )
287290 racc (~> 1.4 )
288291 oj (3.16.7 )
289292 bigdecimal (>= 3.0 )
290293 ostruct (>= 0.2 )
294+ okcomputer (1.19.0 )
291295 omniauth (2.1.2 )
292296 hashie (>= 3.4.6 )
293297 rack (>= 2.2.3 )
@@ -542,6 +546,7 @@ DEPENDENCIES
542546 importmap-rails
543547 jbuilder
544548 jquery-rails
549+ okcomputer (~> 1.19 )
545550 omniauth
546551 omniauth-cas (= 3.0.0 )
547552 omniauth-rails_csrf_protection (~> 1.0 )
Original file line number Diff line number Diff line change 1+ # initializers/okcomputer.rb
2+ # Health checks configuration
3+
4+ OkComputer . mount_at = false
5+ OkComputer . logger = Rails . logger
6+ OkComputer . check_in_parallel = true
7+
8+ # Check the Solr connection
9+ # Requires the ping handler on the solr core (<core>/admin/ping).
10+ core_baseurl = Blacklight . default_index . connection . uri . to_s . chomp ( '/' )
11+ OkComputer ::Registry . register 'solr' , OkComputer ::SolrCheck . new ( core_baseurl )
12+
13+ # Check that DB migrations have run
14+ OkComputer ::Registry . register 'database-migrations' , OkComputer ::ActiveRecordMigrationsCheck . new
Original file line number Diff line number Diff line change 1+ require 'okcomputer'
2+
13Rails . application . routes . draw do
24 mount Blacklight ::Engine => '/'
35 root to : 'catalog#index'
4042 concerns :gbl_downloadable
4143 end
4244 resources :download , only : [ :show ]
45+
46+ # Map OkComputer's /health/all.json to /health
47+ # Don't mount any other routes
48+ get "/health" , to : "ok_computer/ok_computer#index" , defaults : { format : :json }
4349end
Original file line number Diff line number Diff line change 182182 the PingRequestHandler.
183183 relative paths are resolved against the data dir
184184 -->
185- <str name =" healthcheckFile" >server-enabled.txt</str >
185+ <!-- < str name="healthcheckFile">server-enabled.txt</str> -- >
186186 </requestHandler >
187187
188188 <requestHandler name =" /analysis/field"
Original file line number Diff line number Diff line change 182182 the PingRequestHandler.
183183 relative paths are resolved against the data dir
184184 -->
185- <str name =" healthcheckFile" >server-enabled.txt</str >
185+ <!-- < str name="healthcheckFile">server-enabled.txt</str> -- >
186186 </requestHandler >
187187
188188 <requestHandler name =" /analysis/field"
Original file line number Diff line number Diff line change 1+ require 'rails_helper'
2+
3+ RSpec . describe '/health' , type : :request do
4+ it 'renders health checks' do
5+ get '/health'
6+ expect ( response ) . to have_http_status :ok
7+ expect ( response . parsed_body . keys ) . to match_array %w(
8+ default
9+ database
10+ database-migrations
11+ solr
12+ )
13+ end
14+ end
You can’t perform that action at this time.
0 commit comments