simple deadlock retry
This commit is contained in:
parent
7853940813
commit
2750fa4aaa
|
@ -83,13 +83,18 @@ module Hydra #:nodoc:
|
||||||
|
|
||||||
# Process the results coming back from the worker.
|
# Process the results coming back from the worker.
|
||||||
def process_results(worker, message)
|
def process_results(worker, message)
|
||||||
@incomplete_files.delete_at(@incomplete_files.index(message.file))
|
if message.output =~ /ActiveRecord::StatementInvalid(.*)[Dd]eadlock/
|
||||||
trace "#{@incomplete_files.size} Files Remaining"
|
trace "Deadlock detected running [#{message.file}]. Will retry at the end"
|
||||||
@event_listeners.each{|l| l.file_end(message.file, message.output) }
|
@files.push(message.file)
|
||||||
if @incomplete_files.empty?
|
|
||||||
shutdown_all_workers
|
|
||||||
else
|
else
|
||||||
send_file(worker)
|
@incomplete_files.delete_at(@incomplete_files.index(message.file))
|
||||||
|
trace "#{@incomplete_files.size} Files Remaining"
|
||||||
|
@event_listeners.each{|l| l.file_end(message.file, message.output) }
|
||||||
|
if @incomplete_files.empty?
|
||||||
|
shutdown_all_workers
|
||||||
|
else
|
||||||
|
send_file(worker)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue