mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Revert "Merge pull request #39472"
This change broke config.active_job.queue_name_prefix with eager-loading enabled (i.e. in production, by default). This reverts commita173a65730
, reversing changes made to89414f561a
.
This commit is contained in:
parent
2c4cbf26c8
commit
c89632abf0
2 changed files with 16 additions and 22 deletions
|
@ -13,23 +13,28 @@ module ActiveJob
|
|||
ActiveSupport.on_load(:active_job) { self.logger = ::Rails.logger }
|
||||
end
|
||||
|
||||
initializer "active_job.set_configs" do
|
||||
config.after_initialize do |app|
|
||||
options = app.config.active_job
|
||||
options.queue_adapter ||= :async
|
||||
|
||||
custom_serializers = options.delete(:custom_serializers)
|
||||
initializer "active_job.custom_serializers" do |app|
|
||||
config.after_initialize do
|
||||
custom_serializers = app.config.active_job.delete(:custom_serializers)
|
||||
ActiveJob::Serializers.add_serializers custom_serializers
|
||||
end
|
||||
end
|
||||
|
||||
ActiveSupport.on_load(:active_job) do
|
||||
options.each { |k, v| send("#{k}=", v) }
|
||||
end
|
||||
initializer "active_job.set_configs" do |app|
|
||||
options = app.config.active_job
|
||||
options.queue_adapter ||= :async
|
||||
|
||||
ActiveSupport.on_load(:action_dispatch_integration_test) do
|
||||
include ActiveJob::TestHelper
|
||||
ActiveSupport.on_load(:active_job) do
|
||||
options.each do |k, v|
|
||||
k = "#{k}="
|
||||
send(k, v) if respond_to? k
|
||||
end
|
||||
end
|
||||
|
||||
ActiveSupport.on_load(:action_dispatch_integration_test) do
|
||||
include ActiveJob::TestHelper
|
||||
end
|
||||
|
||||
ActiveSupport.on_load(:active_record) do
|
||||
self.destroy_association_async_job = ActiveRecord::DestroyAssociationAsyncJob
|
||||
end
|
||||
|
|
|
@ -2379,17 +2379,6 @@ module ApplicationTests
|
|||
assert_equal "async", ActionView::Helpers::AssetTagHelper.image_decoding
|
||||
end
|
||||
|
||||
test "raises when unknown configuration option is set for ActiveJob" do
|
||||
add_to_config <<-RUBY
|
||||
config.active_job.unknown = "test"
|
||||
RUBY
|
||||
|
||||
assert_raise(NoMethodError) do
|
||||
app "development"
|
||||
ActiveJob::Base # load active_job
|
||||
end
|
||||
end
|
||||
|
||||
test "ActiveJob::Base.retry_jitter is 0.15 by default for new apps" do
|
||||
app "development"
|
||||
|
||||
|
|
Loading…
Reference in a new issue