Sha256: 2c54a649b049a0e343cb29da8a9f376854569a52cb3037adf0c92f3c8e3bff86

Contents?: true

Size: 897 Bytes

Versions: 6

Compression:

Stored size: 897 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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activerecord-mysql-reconnect-0.4.0 lib/activerecord/mysql/reconnect/base_ext.rb
activerecord-mysql-reconnect-0.3.9 lib/activerecord/mysql/reconnect/base_ext.rb
activerecord-mysql-reconnect-0.3.7 lib/activerecord/mysql/reconnect/base_ext.rb
activerecord-mysql-reconnect-0.3.6 lib/activerecord/mysql/reconnect/base_ext.rb
activerecord-mysql-reconnect-0.3.5 lib/activerecord/mysql/reconnect/base_ext.rb
activerecord-mysql-reconnect-0.3.4 lib/activerecord/mysql/reconnect/base_ext.rb