Skip to content

gem 'flipper-active_record' is messing with the queue adaptor. #767

@myxoh

Description

@myxoh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions