Sha256: a66b147eb9c2c92cc2ee20f83192ea1ae699364793869e1590268a58fba2addd

Contents?: true

Size: 1009 Bytes

Versions: 1

Compression:

Stored size: 1009 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
  class_attribute :before_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 before_retry=(v)
      Activerecord::Mysql::Reconnect.before_retry = v
    end

    def before_retry
      Activerecord::Mysql::Reconnect.before_retry
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord-mysql-reconnect-before-retry-0.5.0 lib/activerecord/mysql/reconnect/base_ext.rb