11# frozen_string_literal: true
22
3+ require 'berkeley_library/util/uris/head_check'
4+
35# Health check configuration
46
57OkComputer . logger = Rails . logger
6- OkComputer . check_in_parallel = true
8+ OkComputer . check_in_parallel = ! Rails . env . test?
79
810ALMA_TEST_ID = 'b23305522'
911TIND_TEST_ID = '(pacradio)01469'
@@ -26,29 +28,13 @@ def check
2628 end
2729end
2830
29- class HeadCheck < OkComputer ::HttpCheck
30- def perform_request
31- Timeout . timeout ( request_timeout ) do
32- options = { read_timeout : request_timeout }
33-
34- if basic_auth_options . any?
35- options [ :http_basic_authentication ] = basic_auth_options
36- end
37-
38- RestClient . head ( url . to_s , options )
39- end
40- rescue => e
41- raise ConnectionFailed , e
42- end
43- end
44-
4531# Ensure Alma API is working.
46- OkComputer ::Registry . register 'alma-metadata' , HeadCheck . new ( ALMA_TEST_URL )
32+ OkComputer ::Registry . register 'alma-metadata' , BerkeleyLibrary :: Util :: HeadCheck . new ( ALMA_TEST_URL )
4733
4834# Ensure TIND API is working. This cannot use `OkComputer::HttpCheck`
4935# out of the box as we can't yet inject headers into the request without
5036# subclassing the whole thing.
5137OkComputer ::Registry . register 'tind-metadata' , TindCheck . new
5238
5339# Ensure Wowza is working
54- OkComputer ::Registry . register 'wowza-streaming' , HeadCheck . new ( WOWZA_TEST_URL )
40+ OkComputer ::Registry . register 'wowza-streaming' , BerkeleyLibrary :: Util :: HeadCheck . new ( WOWZA_TEST_URL )
0 commit comments