def perform
refund_log = {
success: refund_retry.success?,
amount: refund_amount,
action: "refund"
}
if refund_retry.success?
refund_log[:reference] = refund_retry.transaction.id
refund_log[:message] = refund_retry.transaction.status
else
refund_log[:message] = refund_retry.message
refund_log[:params] = {}
refund_retry.errors.each do |error|
refund_log[:params][error.code] = error.message
end
order_transaction.message = refund_log[:params].values.join('|')
raise "delayed RefundJob has failed"
end
end
当我在 else 语句中提出“延迟的 RefundJob 失败”时,它会创建一个Airbrake。如果它在 else 部分结束,我想再次运行该作业。
有没有办法在不引发异常的情况下重新排队工作?并防止产生空气制动?
我正在使用延迟作业版本 1。