Sha256: 6a8e4799c951b2c5e9f19e74bb82756da0c594878e3eb50aa4fbb6bcce7570da
Contents?: true
Size: 1.05 KB
Versions: 20
Compression:
Stored size: 1.05 KB
Contents
# frozen_string_literal: true module Orchestration module Services module Mongo class Healthcheck include HealthcheckBase dependencies 'mongoid' def connection_errors return [Moped::Errors::ConnectionFailure] if defined?(Moped) [::Mongo::Error::NoServerAvailable] end def connect silence_warnings # 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) !default_client.database_names.empty? end private def default_client return Mongoid.default_client if Mongoid.respond_to?(:default_client) # Support older versions of Mongoid Mongoid.default_session end def silence_warnings if defined?(Moped) Moped.logger = Logger.new(devnull) else Mongoid.logger = Logger.new(devnull) end end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems