Skip to content

Commit

Permalink
Merge pull request otwcode#2465 from zz9pzza/AO3-4575
Browse files Browse the repository at this point in the history
AO3-4575 Add activerecord-mysql-reconnect gem
  • Loading branch information
sarken committed Jun 30, 2016
2 parents 364d366 + a83ba72 commit 9f0a77f
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ gem 'rails', '3.2.22.2'
gem 'mysql2', '~> 0.3.20'
#https://github.com/qertoip/transaction_retry
gem 'transaction_retry'
#https://github.com/winebarrel/activerecord-mysql-reconnect
gem 'activerecord-mysql-reconnect'

# Version of redis-rb gem
# We are currently running Redis 2.6.4 (12/6/2012)
Expand Down
4 changes: 4 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ GEM
activesupport (= 3.2.22.2)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activerecord-mysql-reconnect (0.4.0)
activerecord
mysql2
activeresource (3.2.22.2)
activemodel (= 3.2.22.2)
activesupport (= 3.2.22.2)
Expand Down Expand Up @@ -398,6 +401,7 @@ PLATFORMS
x86-mingw32

DEPENDENCIES
activerecord-mysql-reconnect
acts_as_list
addressable
akismetor
Expand Down
8 changes: 8 additions & 0 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,12 @@
# :exception_recipients => ArchiveConfig.ERROR_ADDRESS
# end

# https://github.com/winebarrel/activerecord-mysql-reconnect
config.active_record.enable_retry = true
config.active_record.execution_tries = 20 # times
config.active_record.execution_retry_wait = 0.3 # sec
# :rw Retry in all SQL, but does not retry if Lost connection has happened in write SQL
config.active_record.retry_mode = :rw


end
8 changes: 8 additions & 0 deletions config/environments/staging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,12 @@
Bullet.counter_cache_enable = false
end

# https://github.com/winebarrel/activerecord-mysql-reconnect
config.active_record.enable_retry = true
config.active_record.execution_tries = 20 # times
config.active_record.execution_retry_wait = 0.3 # sec
# :rw Retry in all SQL, but does not retry if Lost connection has happened in write SQL
config.active_record.retry_mode = :rw


end
8 changes: 8 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@

# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr

# https://github.com/winebarrel/activerecord-mysql-reconnect
config.active_record.enable_retry = true
config.active_record.execution_tries = 20 # times
config.active_record.execution_retry_wait = 0.3 # sec
# :rw Retry in all SQL, but does not retry if Lost connection has happened in write SQL
config.active_record.retry_mode = :rw

end

0 comments on commit 9f0a77f

Please sign in to comment.