Sha256: 4811a68e6ecf29d3635287b63ab3070d79f34d1a393c70c85beb87e5be7ec551

Contents?: true

Size: 772 Bytes

Versions: 5

Compression:

Stored size: 772 Bytes

Contents

class ActiveRecord::Base
  class_attribute :execution_tries,      :instance_accessor => false
  class_attribute :execution_retry_wait, :instance_accessor => false
  class_attribute :enable_retry,         :instance_accessor => false

  RETRY_MODES = [:r, :rw, :force]
  DEFAULT_RETRY_MODE = :r

  class << self
    def retry_mode=(v)
       Activerecord::Mysql::Reconnect.retry_mode = v
    end

    def retry_mode
       Activerecord::Mysql::Reconnect.retry_mode
    end

    def retry_databases=(v)
       Activerecord::Mysql::Reconnect.retry_databases = v
    end

    def retry_databases
       Activerecord::Mysql::Reconnect.retry_databases
    end

    def without_retry
      Activerecord::Mysql::Reconnect.without_retry do
        yield
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
activerecord-mysql-reconnect-new-0.6.0 lib/activerecord/mysql/reconnect/base_ext.rb
activerecord-mysql-reconnect-0.5.0 lib/activerecord/mysql/reconnect/base_ext.rb
activerecord-mysql-reconnect-0.4.2 lib/activerecord/mysql/reconnect/base_ext.rb
activerecord-mysql-reconnect-0.4.1 lib/activerecord/mysql/reconnect/base_ext.rb
activerecord-mysql-reconnect-0.4.1.beta lib/activerecord/mysql/reconnect/base_ext.rb