Skip to content

Commit

Permalink
catch out of disk space error and other unhandled errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brianlball committed Aug 8, 2024
1 parent 95241b9 commit 9570daf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions server/app/jobs/resque_jobs/run_simulate_data_point.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ def self.perform(data_point_id, options = {})
msg = "SKIPPING #{data_point_id} since it is #{statuses[:status]} and #{statuses[:status_message]}"
d.add_to_rails_log(msg)
end
rescue Resque::TermException => e
rescue Errno::ENOSPC, Resque::DirtyExit, Resque::TermException, Resque::PruneDeadWorkerDirtyExit => e
# Log the termination and re-enqueue attempt
d.add_to_rails_log("Worker Caught TermException: #{e.inspect}: Re-enqueueing DataPoint ID #{data_point_id}")
d.add_to_rails_log("Worker Caught Exception: #{e.inspect}: Re-enqueueing DataPoint ID #{data_point_id}")
Resque.enqueue(self, data_point_id, options)
d.add_to_rails_log("DataPoint #{data_point_id} re-enqueued.")
rescue => e
d.add_to_rails_log("Worker Caught Unhandled Exception: #{e.message}: Re-enqueueing DataPoint ID #{data_point_id}")
Resque.enqueue(self, data_point_id, options)
d.add_to_rails_log("Unhandled exception, re-enqueued DataPoint.")
end
end
end

0 comments on commit 9570daf

Please sign in to comment.