我正在运行此后台作业,并且重试块有效,但我只是不希望我的日志因回溯而阻塞。如果我没记错的话,Sidekiq有一个backtrace: false
选项,activejob有类似的东西吗?
class SomeJob < ApplicationJob
retry_on SomeCustomException do |exception|
#this gets executed AFTER the backtrace has been executed
end
def perform
raise SomeCustomException
end
end
回溯:
[ActiveJob] [SomeJob] [76f9a4d2-ba00-463a-9d5b-2837a12b6e1e]
Error performing SomeJob (Job ID: 76f9a4d2-ba00-463a-9d5b-
2837a12b6e1e) from Async(default) in 4.52ms:
SomeCustomException (SomeCustomException):
******MULTIPLE LINES OF CLUTTER HERE*******