Eagerly autoload ActiveJob::Base
; clean up framework deferred-loading logic to use nested on_load
blocks
#931
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reminded by #930 that I wanted to clean this up after learning about nested blocks in rails/rails#45476
Also, I added a reference to
ActiveJob::Base
. I hope that does not cause a deadlock, but inspecting this it does appear that once rails/rails#45476 is released in Rails 7.1, it's no longer guaranteed that an async executor will be initialized at startup unless both Active Record (which I think will happen because of of the Migration tracker) and Active Job (less likely to happen) are initialized.Within GoodJob development, I noticed that some of the autoload behavior was masked by the gem
activerecord-explain-analyze
autoloading Active Record via this initializer in Rails: https://github.com/bensheldon/rails/blob/70d3b8760fb625d0ebc8b2d0482c45645d3bb7b8/activerecord/lib/active_record/railtie.rb#L88-L92