module Sequel::ConnectionValidator

  1. lib/sequel/extensions/connection_validator.rb
Parent: Sequel

Methods

Public Class

  1. extended

Public Instance

  1. connection_validation_timeout

Attributes

connection_validation_timeout [RW]

The number of seconds that need to pass since connection checkin before attempting to validate the connection when checking it out from the pool. Defaults to 3600 seconds (1 hour).

Public Class methods

extended (pool)

Initialize the data structures used by this extension.

[show source]
# File lib/sequel/extensions/connection_validator.rb, line 57
def self.extended(pool)
  pool.instance_eval do
    @connection_timestamps ||= {}
    @connection_validation_timeout = 3600
  end

  # Make sure the valid connection SQL query is precached,
  # otherwise it's possible it will happen at runtime. While
  # it should work correctly at runtime, it's better to avoid
  # the possibility of failure altogether.
  pool.db.send(:valid_connection_sql)
end