define SIDEKIQ_ENABLE constant

This commit is contained in:
simon lehericey 2024-04-04 16:37:23 +02:00
parent d08803d17a
commit e06fb54655
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5

View file

@ -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