From 97faf0515dc42767c91a8679edc694e16453d580 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Wed, 22 Jan 2025 19:28:36 -0500 Subject: [PATCH] Move ActiveJob config to initializer --- config/environments/development.rb | 2 -- config/environments/production.rb | 6 ------ config/initializers/active_job.rb | 3 +++ 3 files changed, 3 insertions(+), 8 deletions(-) create mode 100644 config/initializers/active_job.rb diff --git a/config/environments/development.rb b/config/environments/development.rb index b58382c..cc74530 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -72,6 +72,4 @@ Rails.application.configure do # Apply autocorrection by RuboCop to files generated by `bin/rails generate`. # config.generators.apply_rubocop_autocorrect_after_generate! - # Use a real queuing backend for Active Job (and separate queues per environment). - config.active_job.queue_adapter = :solid_queue end diff --git a/config/environments/production.rb b/config/environments/production.rb index f29c82a..153be7e 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -86,10 +86,4 @@ Rails.application.configure do # # Skip DNS rebinding protection for the default health check endpoint. # config.host_authorization = { exclude: ->(request) { request.path == "/up" } } - - # Use a real queuing backend for Active Job (and separate queues per environment). - config.active_job.queue_adapter = :solid_queue - config.solid_queue.connects_to = { database: { writing: :queue } } - - # config.active_job.queue_name_prefix = "family_budget_production" end diff --git a/config/initializers/active_job.rb b/config/initializers/active_job.rb new file mode 100644 index 0000000..c6d6b95 --- /dev/null +++ b/config/initializers/active_job.rb @@ -0,0 +1,3 @@ +# Use a real queuing backend for Active Job (and separate queues per environment). +Rails.application.config.active_job.queue_adapter = :solid_queue +Rails.application.config.solid_queue.connects_to = { database: { writing: :queue } }