1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/test/jobs
Edouard CHIN bbfab0b33a Don't run AJ after_enqueue / after_perform when chain is halted:
- ### Problem

  ```ruby
    MyJob < ApplicationJob
      before_enqueue { throw(:abort) }
      after_enqueue { # enters here }
    end
  ```
  I find AJ behaviour on after_enqueue and after_perform callbacks
  weird as they get run even when the callback chain is halted.
  It's counter intuitive to run the after_enqueue callbacks even
  though the job wasn't event enqueued.

  ### Solution

  In Rails 6.2, I propose to make the new behaviour the default
  and stop running after callbacks when the chain is halted.
  For application that wants this behaviour now or in 6.1
  they can do so by adding the `config.active_job.skip_after_callbacks_if_terminated = true`
  in their configuration file.
2019-12-09 17:17:23 +01:00
..
abort_before_enqueue_job.rb Don't run AJ after_enqueue / after_perform when chain is halted: 2019-12-09 17:17:23 +01:00
application_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
callback_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
disable_log_job.rb Add an option to disable logging for jobs with sensitive arguments 2019-11-08 13:53:23 -05:00
gid_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
hello_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
inherited_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
kwargs_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
logging_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
multiple_kwargs_job.rb Make assert_<enqueued|performed>_with() compare hashes ignoring order of keys 2018-09-21 00:09:40 +05:30
nested_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
overridden_logging_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
prefixed_job.rb Stop queue_name_prefix from being global 2019-09-13 18:30:19 -03:00
provider_jid_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
queue_adapter_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
queue_as_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
rescue_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
retry_job.rb Rewrite ActiveJob exception tests so it runs with the real adapters 2019-01-08 12:07:38 +01:00
thread_job.rb Run inline jobs in separate threads 2019-11-01 20:14:40 -04:00
timezone_dependent_job.rb Require time extensions in the job that depends on time 2019-08-02 00:52:02 -04:00
translated_hello_job.rb [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00