Sha256: 3f54212114ef5fb913bfa23417ff66adb1b3e0816667b41d52d081164798dcfb
Contents?: true
Size: 609 Bytes
Versions: 1
Compression:
Stored size: 609 Bytes
Contents
module Hcheck module Checks # mongodb check module # implements status # include mongodb check dependencies module Mongodb # @config { hosts, user, password } def status(config) mongo_config = config.merge(connect_timeout: 3) hosts = mongo_config.delete(:hosts).compact client = Mongo::Client.new(hosts, mongo_config.merge(server_selection_timeout: hosts.count * 2)) client.database_names client.close end def self.included(_base) require 'mongo' Mongo::Logger.level = Logger::INFO end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
hcheck-0.1.1 | lib/hcheck/checks/mongodb.rb |