Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save kjlape/5cb04b8e804150556c5be907ba22a1eb to your computer and use it in GitHub Desktop.

Select an option

Save kjlape/5cb04b8e804150556c5be907ba22a1eb to your computer and use it in GitHub Desktop.
Surprising ActiveJob instrumentation changes from 5.2 to 6.0

The behavior of enqueue.active_job changed slightly between Rails 5.2 and 6.0. In 5.2 the event doesn't fire if there's an error queuing the job. In 6.0 it always fires regardless of error.

Relevant rails code is…

One more interesting difference between 5.2 and 6.0 here is that 5.2 did not include timing information since it fires in an after_enqueue. In 6.0 it has moved to around_enqueue and passes the block to be instrumented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment