提交 4b96907e 编写于 作者: A Ariejan de Vroom

Merge pull request #603 from yvmarques/patch-1

Changed for mysql2 adapter
module ActiveRecord::ConnectionAdapters
class MysqlAdapter
class Mysql2Adapter
alias_method :execute_without_retry, :execute
def execute(*args)
execute_without_retry(*args)
rescue ActiveRecord::StatementInvalid => e
rescue Mysql2::Error => e
if e.message =~ /server has gone away/i
warn "Server timed out, retrying"
reconnect!
......@@ -14,4 +14,4 @@ module ActiveRecord::ConnectionAdapters
end
end
end
end
end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册