如何在activejob重试中删除回溯?

时间:2018-12-06 21:27:59

标签: ruby-on-rails ruby

我正在运行此后台作业,并且重试块有效,但我只是不希望我的日志因回溯而阻塞。如果我没记错的话,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*******

0 个答案:

没有答案