1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

5 commits

Author SHA1 Message Date
Edouard CHIN
ca61139fae Fix wrong logging message in AJ in case a job returns a falsey value:
- I made a change in 0d3aec4969 to output a log if a job was aborted
  in a before callbacks. I didn't take in consideration that a job
  could return a falsy value and thus it would wrongly log
  that the job was aborted.

  This fixes the problem by checking if the callback chain was halted
  rather than the return value of the job.
2020-01-03 17:14:56 +01:00
Edouard CHIN
0d3aec4969 Fix ActiveJob logging when callback chain is halted:
- ### Problem

  ActiveJob will always log "Enqueued MyJob (Job ID) ..." even
  if the job doesn't get enqueued through the adapter.
  Same problem happens when performing a Job, "Performed MyJob (Job ID) ..." will be logged even when job wasn't performed at all.
  This situation can happen either if the callback chain is terminated
  (before_enqueue throwing an `abort`) or if an exception is raised.

  ### Solution

  Check if the callback chain is aborted/exception is raised, and  log accordingly.
2019-12-09 16:17:55 +01:00
George Claghorn
efbab35929 Delegate ActiveJob::Base#queue_adapter to class 2019-09-23 16:55:36 -04:00
George Claghorn
820cc8012b
Move ActiveJob::Exceptions#instrument to ActiveJob::Instrumentation 2019-09-23 16:13:54 -04:00
George Claghorn
2c14a0f16d
Extract ActiveJob::Instrumentation 2019-09-23 12:29:52 -04:00