Module: Orchestration::Services::HTTPHealthcheck

Included in:
App::Healthcheck, Mongo::Healthcheck
Defined in:
lib/orchestration/services/mixins/http_healthcheck.rb

Instance Method Summary collapse

Instance Method Details

#connectObject



6
7
8
9
10
11
12
# File 'lib/orchestration/services/mixins/http_healthcheck.rb', line 6

def connect
  code = Net::HTTP.get_response(
    URI("http://#{@configuration.host}:#{@configuration.port}")
  ).code
  connection_error(code) if connection_error?(code)
  connection_error(code) unless connection_success?(code)
end

#connection_errorsObject



14
15
16
# File 'lib/orchestration/services/mixins/http_healthcheck.rb', line 14

def connection_errors
  [Errno::ECONNREFUSED, HTTPConnectionError]
end