Sha256: 1f3f398ec201067c7d2627682dba49adeafc2ad2c0cd50fb23acc13dd5cefd2f

Contents?: true

Size: 568 Bytes

Versions: 3

Compression:

Stored size: 568 Bytes

Contents

# frozen_string_literal: true

module Orchestration
  module Services
    module Mongo
      class Healthcheck
        include HealthcheckBase

        dependencies 'mongoid'

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

        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
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
orchestration-0.2.6 lib/orchestration/services/mongo/healthcheck.rb
orchestration-0.2.5 lib/orchestration/services/mongo/healthcheck.rb
orchestration-0.2.4 lib/orchestration/services/mongo/healthcheck.rb