record errors on the shard they are for

Change-Id: I99f28a012d153ae87ed7fb00860254a5122519b5
Reviewed-on: https://gerrit.instructure.com/60502
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: August Thornton <august@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2015-08-11 10:54:37 -06:00
parent 26bd8a2a88
commit de1d3dcce5
1 changed files with 7 additions and 1 deletions

View File

@ -107,5 +107,11 @@ end
Delayed::Worker.lifecycle.before(:error) do |worker, job, exception|
info = Canvas::Errors::JobInfo.new(job, worker)
Canvas::Errors.capture(exception, info.to_h)
begin
(job.current_shard || Shard.default).activate do
Canvas::Errors.capture(exception, info.to_h)
end
rescue
Canvas::Errors.capture(exception, info.to_h)
end
end