Commit 4b96907e7cc7cef55034499c2d5c5d0998637c99

Authored by Ariejan de Vroom
2 parents 3b4e7b31 2519ecf6

Merge pull request #603 from yvmarques/patch-1

Changed for mysql2 adapter
Showing 1 changed file with 3 additions and 3 deletions   Show diff stats
config/initializers/connection_fix.rb
1 1 module ActiveRecord::ConnectionAdapters
2   - class MysqlAdapter
  2 + class Mysql2Adapter
3 3 alias_method :execute_without_retry, :execute
4 4  
5 5 def execute(*args)
6 6 execute_without_retry(*args)
7   - rescue ActiveRecord::StatementInvalid => e
  7 + rescue Mysql2::Error => e
8 8 if e.message =~ /server has gone away/i
9 9 warn "Server timed out, retrying"
10 10 reconnect!
... ... @@ -14,4 +14,4 @@ module ActiveRecord::ConnectionAdapters
14 14 end
15 15 end
16 16 end
17 17 -end
  18 +end
18 19 \ No newline at end of file
... ...