class OkComputer::ActionMailerCheck
Verifies if the mail server configured for ActionMailer is responding.
Attributes
host[RW]
klass[RW]
port[RW]
timeout[RW]
Public Class Methods
new(klass = ActionMailer::Base, timeout = 5)
click to toggle source
Calls superclass method
# File lib/ok_computer/built_in_checks/action_mailer_check.rb, line 7 def initialize(klass = ActionMailer::Base, timeout = 5) self.klass = klass self.timeout = timeout host = klass.smtp_settings[:address] port = klass.smtp_settings[:port] || 25 super(host, port, timeout) end
Public Instance Methods
check()
click to toggle source
Public: Return the status of the check
# File lib/ok_computer/built_in_checks/action_mailer_check.rb, line 16 def check tcp_socket_request mark_message "#{klass} check to #{host}:#{port} successful" rescue => e mark_message "#{klass} at #{host}:#{port} is not accepting connections: '#{e}'" mark_failure end