Class: Liveness::Dependencies::MySQL

Inherits:
Liveness::Dependency show all
Defined in:
lib/liveness/dependencies/mysql.rb

Overview

The MySQL Provider

Since:

  • 0.1.0

Instance Attribute Summary

Attributes inherited from Liveness::Dependency

#name, #timeout

Instance Method Summary collapse

Methods inherited from Liveness::Dependency

#alive?, #connect, #initialize, #status

Constructor Details

This class inherits a constructor from Liveness::Dependency

Instance Method Details

#check!Object

See Also:

  • Liveness::Dependencies::MySQL.[Liveness[Liveness::Dependency[Liveness::Dependency#check!]

Since:

  • 0.1.0



13
14
15
16
17
18
# File 'lib/liveness/dependencies/mysql.rb', line 13

def check!
  # TODO: Add Sequel Support
  return false unless defined?(ActiveRecord::Base)

  ActiveRecord::Base.connection.exec_query('SELECT 1 as ping')&.first&.[]('ping')&.to_s == '1'
end