From e06fb5465525aa6488b584c551e58bddf42596c8 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Thu, 4 Apr 2024 16:37:23 +0200 Subject: [PATCH] define SIDEKIQ_ENABLE constant --- config/initializers/transition_to_sidekiq.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/transition_to_sidekiq.rb b/config/initializers/transition_to_sidekiq.rb index 7f319a64c..c9a537362 100644 --- a/config/initializers/transition_to_sidekiq.rb +++ b/config/initializers/transition_to_sidekiq.rb @@ -1,6 +1,6 @@ -sidekiq_enabled = ENV.has_key?('REDIS_SIDEKIQ_SENTINELS') || ENV.has_key?('REDIS_URL') +SIDEKIQ_ENABLED = ENV.has_key?('REDIS_SIDEKIQ_SENTINELS') || ENV.has_key?('REDIS_URL') -if Rails.env.production? && sidekiq_enabled +if Rails.env.production? && SIDEKIQ_ENABLED ActiveSupport.on_load(:after_initialize) do class ActiveStorage::PurgeJob < ActiveStorage::BaseJob self.queue_adapter = :sidekiq