Class: Orchestration::Services::Mongo::Healthcheck

Inherits:
Object
  • Object
show all
Includes:
HealthcheckBase
Defined in:
lib/orchestration/services/mongo/healthcheck.rb

Instance Attribute Summary

Attributes included from HealthcheckBase

#configuration

Instance Method Summary collapse

Methods included from HealthcheckBase

included

Constructor Details

#initialize(env) ⇒ Healthcheck



9
10
11
# File 'lib/orchestration/services/mongo/healthcheck.rb', line 9

def initialize(env)
  @configuration = Configuration.new(env)
end

Instance Method Details

#connectObject



17
18
19
20
21
22
# File 'lib/orchestration/services/mongo/healthcheck.rb', line 17

def connect
  # REVIEW: For some reason this is extremely slow. Worth trying
  # to see if there's a faster way to fail.
  Mongoid.load_configuration(@configuration.settings)
  !Mongoid.default_client.database_names.empty?
end

#connection_errorsObject



13
14
15
# File 'lib/orchestration/services/mongo/healthcheck.rb', line 13

def connection_errors
  [::Mongo::Error::NoServerAvailable]
end