10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/barsoom_utils/ping_health_check.rb', line 10
def call
return unless ENV["ENABLE_HEALTH_CHECKS"]
response = ping_healthcheck
if response.code != 200
raise "Bad response, cf-request-id header: #{response.headers["cf-request-id"]}, response body: #{response.inspect}"
else
response
end
rescue => ex
BarsoomUtils::ExceptionNotifier.message("Couldn't report to healthchecks.io, maybe the service is down?", "Check: #{id}, Error: #{ex.inspect}")
end
|