AO3-4575 Add activerecord-mysql-reconnect gem #2465
+30
−0
Whoops, actually, doesn't this need a configuration? Per https://github.com/winebarrel/activerecord-mysql-reconnect?
config/environments/test.rb
| @@ -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 | ||
| + |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
config/environments/staging.rb
| @@ -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 | ||
| + | ||
| + |
|
Extra blank line detected.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
config/environments/production.rb
| @@ -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 | ||
| + | ||
| + |
|
Extra blank line detected.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
|
Do we really want 20 retries over 6 seconds? Wouldn't it be safer to do, say, 3 retries and then give up? I'm happy to be convinced otherwise, just want to know what the reason is for this configuration, since there's no commenting or info in the issue.
2 checks passed
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
hound
5 violations found.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://otwarchive.atlassian.net/browse/AO3-4575