Skip to content

Commit

Permalink
do not requeue in RunSimulateDataPoint for failures. might cause infi…
Browse files Browse the repository at this point in the history
…nite loop
  • Loading branch information
brianlball committed Aug 16, 2024
1 parent 7427999 commit ab0a4e0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions server/app/jobs/resque_jobs/run_simulate_data_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ def self.perform(data_point_id, options = {})
end
rescue SignalException, Errno::ENOSPC, Resque::DirtyExit, Resque::TermException, Resque::PruneDeadWorkerDirtyExit => e
# Log the termination and re-enqueue attempt
d.add_to_rails_log("Worker Caught Exception: #{e.inspect}: Re-enqueueing DataPoint ID #{data_point_id}")
Resque.enqueue_to(:requeued, self, data_point_id, options)
puts "DataPoint #{data_point_id} re-enqueued."
d.add_to_rails_log("Worker Caught Exception: #{e.inspect}")#: Re-enqueueing DataPoint ID #{data_point_id}")
#Resque.enqueue_to(:requeued, self, data_point_id, options)
#puts "DataPoint #{data_point_id} re-enqueued."
puts "Worker Caught Exception: #{e.inspect}"
rescue => e
d.add_to_rails_log("Worker Caught Unhandled Exception: #{e.message}: Re-enqueueing DataPoint ID #{data_point_id}")
Resque.enqueue_to(:requeued, self, data_point_id, options)
puts "Unhandled exception, re-enqueued DataPoint."
d.add_to_rails_log("Worker Caught Unhandled Exception: #{e.message}")#: Re-enqueueing DataPoint ID #{data_point_id}")
#Resque.enqueue_to(:requeued, self, data_point_id, options)
#puts "Unhandled exception, re-enqueued DataPoint."
puts "Worker Caught Unhandled Exception: #{e.message}"
end
end
end

0 comments on commit ab0a4e0

Please sign in to comment.