Class: Wellness::Services::PostgresService

Inherits:
Base
  • Object
show all
Defined in:
lib/wellness/services/postgres_service.rb

Overview

Author:

  • Matthew A. Johnston

Instance Method Summary collapse

Methods inherited from Base

#call, #failed_check, #healthy?, #initialize, #last_check, #params, #passed_check

Constructor Details

This class inherits a constructor from Wellness::Services::Base

Instance Method Details

#checkObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/wellness/services/postgres_service.rb', line 8

def check
  case ping
    when PG::Constants::PQPING_NO_ATTEMPT
      ping_failed('no attempt made to ping')
    when PG::Constants::PQPING_NO_RESPONSE
      ping_failed('no response from ping')
    when PG::Constants::PQPING_REJECT
      ping_failed('ping was rejected')
    else
      ping_successful
  end
end