Sha256: 614d63274780e1e854643414c0321da614417bd8ae1c5262f74f9eb8b870e828

Contents?: true

Size: 367 Bytes

Versions: 62

Compression:

Stored size: 367 Bytes

Contents

module Workarea
  module Monitoring
    class MongoidCheck

      def check
        status = database_up?
        [status, status ? 'Up' : 'Down']
      end

      private

      def database_up?
        Mongoid::Clients
          .with_name('default')
          .collections
          .find
          .present?
      rescue
        false
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.15 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.4.36 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.14 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.4.35 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.13 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.4.34 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.12 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.4.33 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.11 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.10 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.4.32 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.9 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.4.31 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.8 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.4.30 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.7 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.4.29 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.6 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.4.28 lib/workarea/monitoring/mongoid_check.rb
workarea-core-3.5.5 lib/workarea/monitoring/mongoid_check.rb