11# frozen_string_literal: true
22
33# Health check configuration
4+ require 'berkeley_library/util/uris/head_check'
45
56OkComputer . logger = Rails . logger
67OkComputer . check_in_parallel = true
@@ -26,3 +27,21 @@ def check
2627
2728# Ensure connectivity to the mail system.
2829OkComputer ::Registry . register 'action-mailer' , OkComputer ::ActionMailerCheck . new
30+
31+ # Ensure TIND API is working.
32+ tind_health_check_url = "#{ Rails . application . config . tind_base_uri } api/v1/search?In=en"
33+ OkComputer ::Registry . register 'thind-api' , BerkeleyLibrary ::Util ::HeadCheck . new ( tind_health_check_url )
34+
35+ # Ensure HathiTrust API is working.
36+ OkComputer ::Registry . register 'hathitrust-api' , BerkeleyLibrary ::Util ::HeadCheck . new ( Rails . application . config . hathiTrust_health_check_url )
37+
38+ # Ensure ARIN Whois API is working.
39+ OkComputer ::Registry . register 'whois-arin-api' , BerkeleyLibrary ::Util ::HeadCheck . new ( Rails . application . config . whois_health_check_url )
40+
41+ # Ensure Berkeley ServiceNow is accessible.
42+ OkComputer ::Registry . register 'berkeley-service-now' , BerkeleyLibrary ::Util ::HeadCheck . new ( Rails . application . config . berkeley_service_now_health_check_url )
43+
44+ # Ensure PayPal Payflow is accessible.
45+ OkComputer ::Registry . register 'paypal-payflow' , OkComputer ::HttpCheck . new ( Rails . application . config . paypal_payflow_url )
46+
47+ # Since the WorldCat API service requests dynamically generated OCLC tokens, we are not doing a health check for it.
0 commit comments