|
1 | 1 | # frozen_string_literal: true |
2 | 2 |
|
3 | 3 | require 'net/smtp' |
| 4 | +require 'berkeley_library/util/uris/head_check' |
4 | 5 |
|
5 | 6 | # Health check configuration |
6 | | - |
7 | 7 | OkComputer.logger = Rails.logger |
8 | 8 | OkComputer.check_in_parallel = true |
9 | 9 |
|
@@ -58,11 +58,29 @@ def check |
58 | 58 | end |
59 | 59 | # rubocop:enable Metrics/MethodLength, Metrics/AbcSize |
60 | 60 |
|
| 61 | +# Ensure SMTP can connect |
| 62 | +OkComputer::Registry.register 'mail-connectivity', MailConnectivityCheck.new if ActionMailer::Base.delivery_method == :smtp |
| 63 | + |
61 | 64 | # Ensure Alma API is working. |
62 | 65 | OkComputer::Registry.register 'alma-patron-lookup', AlmaPatronCheck.new |
63 | 66 |
|
64 | 67 | # Ensure database migrations have been run. |
65 | 68 | OkComputer::Registry.register 'database-migrations', OkComputer::ActiveRecordMigrationsCheck.new |
66 | 69 |
|
67 | | -# Ensure SMTP can connect |
68 | | -OkComputer::Registry.register 'mail-connectivity', MailConnectivityCheck.new if ActionMailer::Base.delivery_method == :smtp |
| 70 | +# Ensure TIND API is working. |
| 71 | +tind_health_check_url = "#{Rails.application.config.tind_base_uri}api/v1/search?In=en" |
| 72 | +OkComputer::Registry.register 'tind-api', BerkeleyLibrary::Util::HeadCheck.new(tind_health_check_url) |
| 73 | + |
| 74 | +# Ensure HathiTrust API is working. |
| 75 | +OkComputer::Registry.register 'hathitrust-api', BerkeleyLibrary::Util::HeadCheck.new(Rails.application.config.x.healthcheck_urls.hathiTrust) |
| 76 | + |
| 77 | +# Ensure ARIN Whois API is working. |
| 78 | +OkComputer::Registry.register 'whois-arin-api', BerkeleyLibrary::Util::HeadCheck.new(Rails.application.config.x.healthcheck_urls.whois) |
| 79 | + |
| 80 | +# Ensure Berkeley ServiceNow is accessible. |
| 81 | +OkComputer::Registry.register 'berkeley-service-now', BerkeleyLibrary::Util::HeadCheck.new(Rails.application.config.x.healthcheck_urls.berkeley_service_now) |
| 82 | + |
| 83 | +# Ensure PayPal Payflow is accessible. |
| 84 | +OkComputer::Registry.register 'paypal-payflow', OkComputer::HttpCheck.new(Rails.application.config.paypal_payflow_url) |
| 85 | + |
| 86 | +# Since the WorldCat API service requests dynamically generated OCLC tokens, we are not doing a health check for it. |
0 commit comments