mirror of https://github.com/rails/rails
make that a private instance method instead
This commit is contained in:
parent
d258bfe8ac
commit
a8cbb96b3d
|
@ -163,9 +163,11 @@ module ActiveJob
|
|||
def around_enqueue(*filters, &blk)
|
||||
set_callback(:enqueue, :around, *filters, &blk)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def warn_against_after_callbacks_execution_deprecation(callbacks) # :nodoc:
|
||||
if !skip_after_callbacks_if_terminated && callbacks.any? { |c| c.kind == :after }
|
||||
if !self.class.skip_after_callbacks_if_terminated && callbacks.any? { |c| c.kind == :after }
|
||||
ActiveSupport::Deprecation.warn(<<~EOM)
|
||||
In Rails 6.2, `after_enqueue`/`after_perform` callbacks no longer run if `before_enqueue`/`before_perform` respectively halts with `throw :abort`.
|
||||
To enable this behavior, uncomment the `config.active_job.skip_after_callbacks_if_terminated` config
|
||||
|
@ -173,6 +175,5 @@ module ActiveJob
|
|||
EOM
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -63,7 +63,7 @@ module ActiveJob
|
|||
if successfully_enqueued
|
||||
self
|
||||
else
|
||||
self.class.warn_against_after_callbacks_execution_deprecation(_enqueue_callbacks)
|
||||
warn_against_after_callbacks_execution_deprecation(_enqueue_callbacks)
|
||||
|
||||
if self.class.return_false_on_aborted_enqueue
|
||||
false
|
||||
|
|
|
@ -42,7 +42,7 @@ module ActiveJob
|
|||
successfully_performed = true
|
||||
end
|
||||
|
||||
self.class.warn_against_after_callbacks_execution_deprecation(_perform_callbacks) unless successfully_performed
|
||||
warn_against_after_callbacks_execution_deprecation(_perform_callbacks) unless successfully_performed
|
||||
successfully_performed
|
||||
rescue => exception
|
||||
rescue_with_handler(exception) || raise
|
||||
|
|
Loading…
Reference in New Issue