Commit 2519ecf6 authored by Yvan's avatar Yvan

Changed for mysql2 adapter

parent 3b4e7b31
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!
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment