11# frozen_string_literal: true
22
33require 'net/smtp'
4-
5- # Health check configuration
64require 'berkeley_library/util/uris/head_check'
75
6+ # Health check configuration
87OkComputer . logger = Rails . logger
98OkComputer . check_in_parallel = true
109
@@ -59,7 +58,8 @@ def check
5958end
6059# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
6160
62- # Since the WorldCat API service requests dynamically generated OCLC tokens, we are not doing a health check for it.
61+ # Ensure SMTP can connect
62+ OkComputer ::Registry . register 'mail-connectivity' , MailConnectivityCheck . new if ActionMailer ::Base . delivery_method == :smtp
6363
6464# Ensure Alma API is working.
6565OkComputer ::Registry . register 'alma-patron-lookup' , AlmaPatronCheck . new
@@ -83,25 +83,4 @@ def check
8383# Ensure PayPal Payflow is accessible.
8484OkComputer ::Registry . register 'paypal-payflow' , OkComputer ::HttpCheck . new ( Rails . application . config . paypal_payflow_url )
8585
86- # Ensure connectivity to the mail system.
87- OkComputer ::Registry . register 'action-mailer' , OkComputer ::ActionMailerCheck . new
88-
89- # Ensure TIND API is working.
90- tind_health_check_url = "#{ Rails . application . config . tind_base_uri } api/v1/search?In=en"
91- OkComputer ::Registry . register 'thind-api' , BerkeleyLibrary ::Util ::HeadCheck . new ( tind_health_check_url )
92-
93- # Ensure HathiTrust API is working.
94- OkComputer ::Registry . register 'hathitrust-api' , BerkeleyLibrary ::Util ::HeadCheck . new ( Rails . application . config . hathiTrust_health_check_url )
95-
96- # Ensure ARIN Whois API is working.
97- OkComputer ::Registry . register 'whois-arin-api' , BerkeleyLibrary ::Util ::HeadCheck . new ( Rails . application . config . whois_health_check_url )
98-
99- # Ensure Berkeley ServiceNow is accessible.
100- OkComputer ::Registry . register 'berkeley-service-now' , BerkeleyLibrary ::Util ::HeadCheck . new ( Rails . application . config . berkeley_service_now_health_check_url )
101-
102- # Ensure PayPal Payflow is accessible.
103- OkComputer ::Registry . register 'paypal-payflow' , OkComputer ::HttpCheck . new ( Rails . application . config . paypal_payflow_url )
104-
10586# Since the WorldCat API service requests dynamically generated OCLC tokens, we are not doing a health check for it.
106- # Ensure SMTP can connect
107- OkComputer ::Registry . register 'mail-connectivity' , MailConnectivityCheck . new if ActionMailer ::Base . delivery_method == :smtp
0 commit comments