Skip to content

Commit

Permalink
Log mysterious rescue in worker
Browse files Browse the repository at this point in the history
  • Loading branch information
hs-arodrigues committed Mar 28, 2024
1 parent 0a41156 commit 7b7c5af
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/que/worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,17 @@ def work_job(metajob)
job.fetch(:id),
]
end
rescue
rescue Exception => error
Que.log(
level: :debug,
event: :job_errored,
job_id: metajob.id,
error: {
class: error.class.to_s,
message: error.message,
backtrace: (error.backtrace || []).join("\n").slice(0, 10000),
},
)
# If we can't reach the database for some reason, too bad, but
# don't let it crash the work loop.
end
Expand Down

0 comments on commit 7b7c5af

Please sign in to comment.