Module: TransactionRetry
- Defined in:
- lib/transaction_retry.rb,
lib/transaction_retry/version.rb,
lib/transaction_retry/active_record/base.rb
Defined Under Namespace
Modules: ActiveRecord
Classes: Railtie
Constant Summary
collapse
- VERSION =
'1.2.0'
Class Method Summary
collapse
Class Method Details
.apply_activerecord_patch ⇒ Object
Must be called after ActiveRecord established a connection. Only then we know which connection adapter is actually loaded and can be enhanced. Please note ActiveRecord does not load unused adapters.
12
13
14
15
|
# File 'lib/transaction_retry.rb', line 12
def self.apply_activerecord_patch
TransactionIsolation.apply_activerecord_patch
require_relative 'transaction_retry/active_record/base'
end
|
.fuzz ⇒ Object
42
43
44
|
# File 'lib/transaction_retry.rb', line 42
def self.fuzz
@@fuzz ||= true
end
|
.fuzz=(val) ⇒ Object
46
47
48
|
# File 'lib/transaction_retry.rb', line 46
def self.fuzz=(val)
@@fuzz = val
end
|
.max_retries ⇒ Object
26
27
28
|
# File 'lib/transaction_retry.rb', line 26
def self.max_retries
@@max_retries ||= 3
end
|
.max_retries=(n) ⇒ Object
30
31
32
|
# File 'lib/transaction_retry.rb', line 30
def self.max_retries=(n)
@@max_retries = n
end
|
.wait_times ⇒ Object
34
35
36
|
# File 'lib/transaction_retry.rb', line 34
def self.wait_times
@@wait_times ||= [0, 1, 2, 4, 8, 16, 32]
end
|
.wait_times=(array_of_seconds) ⇒ Object
38
39
40
|
# File 'lib/transaction_retry.rb', line 38
def self.wait_times=(array_of_seconds)
@@wait_times = array_of_seconds
end
|