This may be specific to our configuration but.
- We are using GoodJob as our queue adaptor
- We are using ActiveRecord as our adaptor for Flipper
- We are using rails 7
Before:
On our initializors we were initializing our Queue in an initialisor like:
config/initializers/queue.rb
Rails.application.configure do
config.active_job.queue_adapter = :good_job
# ... etc
end
After adding the flipper gem, specifically the flipper-active_record - while the queue_adapter was still configured correctly when reading: Rails.configuration.active_job.queue_adapter => :good_job
It was now defaulting to the async adaptor when running: ActiveJob::Base.queue_adapter (And actually using this adaptor).
We manage to pinpoint the issue to requiring the gem which was loading it before the initializors. We fixed the issue by setting
gem 'flipper-active_record' require: false
on the Gemfile and then requiring the gem later down the line after the queue was correctly set.
Ideally - requiring this adaptor should NOT be initializing the queue in any way and causing this kind of dependency issues
This may be specific to our configuration but.
Before:
On our initializors we were initializing our Queue in an initialisor like:
config/initializers/queue.rbAfter adding the flipper gem, specifically the
flipper-active_record- while thequeue_adapterwas still configured correctly when reading:Rails.configuration.active_job.queue_adapter=>:good_jobIt was now defaulting to the async adaptor when running:
ActiveJob::Base.queue_adapter(And actually using this adaptor).We manage to pinpoint the issue to requiring the gem which was loading it before the initializors. We fixed the issue by setting
on the Gemfile and then requiring the gem later down the line after the queue was correctly set.
Ideally - requiring this adaptor should NOT be initializing the queue in any way and causing this kind of dependency issues