Class: ActiveRecord::ConnectionAdapters::MysqlAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/stomp_server_ng/queue/ar_reconnect.rb

Instance Method Summary collapse

Instance Method Details

#execute(*args) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/stomp_server_ng/queue/ar_reconnect.rb', line 5

def execute(*args)
  execute_without_retry(*args)
rescue ActiveRecord::StatementInvalid
  if $!.message =~ /server has gone away/i
    warn "Server timed out, retrying"
    reconnect!
    retry
  end

  raise
end

#execute_without_retryObject



4
# File 'lib/stomp_server_ng/queue/ar_reconnect.rb', line 4

alias_method :execute_without_retry, :execute